summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>2015-09-26 14:22:10 +0530
committerTomi Valkeinen <tomi.valkeinen@ti.com>2015-09-30 10:33:57 +0300
commit4d370b74e7ce175f26654fe2db49db342566cdc8 (patch)
treeeac6015dbf2e77673892dfa667141980f568c9b1
parent4bdb4629867babb7a3d93548aa69a4ef07fc36c0 (diff)
downloadblackbird-op-linux-4d370b74e7ce175f26654fe2db49db342566cdc8.tar.gz
blackbird-op-linux-4d370b74e7ce175f26654fe2db49db342566cdc8.zip
fbdev: broadsheetfb: fix memory leak
We have requested the firmware and it was loaded but we missed releasing it both on success and error. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--drivers/video/fbdev/broadsheetfb.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/video/fbdev/broadsheetfb.c b/drivers/video/fbdev/broadsheetfb.c
index 0e5fde1d3ffb..9f9a7bef1ff6 100644
--- a/drivers/video/fbdev/broadsheetfb.c
+++ b/drivers/video/fbdev/broadsheetfb.c
@@ -752,7 +752,7 @@ static ssize_t broadsheet_loadstore_waveform(struct device *dev,
if ((fw_entry->size < 8*1024) || (fw_entry->size > 64*1024)) {
dev_err(dev, "Invalid waveform\n");
err = -EINVAL;
- goto err_failed;
+ goto err_fw;
}
mutex_lock(&(par->io_lock));
@@ -762,13 +762,15 @@ static ssize_t broadsheet_loadstore_waveform(struct device *dev,
mutex_unlock(&(par->io_lock));
if (err < 0) {
dev_err(dev, "Failed to store broadsheet waveform\n");
- goto err_failed;
+ goto err_fw;
}
dev_info(dev, "Stored broadsheet waveform, size %zd\n", fw_entry->size);
- return len;
+ err = len;
+err_fw:
+ release_firmware(fw_entry);
err_failed:
return err;
}
OpenPOWER on IntegriCloud