mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-15 01:44:52 +00:00
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>
This commit is contained in:
parent
4bdb462986
commit
4d370b74e7
@ -752,7 +752,7 @@ static ssize_t broadsheet_loadstore_waveform(struct device *dev,
|
|||||||
if ((fw_entry->size < 8*1024) || (fw_entry->size > 64*1024)) {
|
if ((fw_entry->size < 8*1024) || (fw_entry->size > 64*1024)) {
|
||||||
dev_err(dev, "Invalid waveform\n");
|
dev_err(dev, "Invalid waveform\n");
|
||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
goto err_failed;
|
goto err_fw;
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_lock(&(par->io_lock));
|
mutex_lock(&(par->io_lock));
|
||||||
@ -762,13 +762,15 @@ static ssize_t broadsheet_loadstore_waveform(struct device *dev,
|
|||||||
mutex_unlock(&(par->io_lock));
|
mutex_unlock(&(par->io_lock));
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
dev_err(dev, "Failed to store broadsheet waveform\n");
|
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);
|
dev_info(dev, "Stored broadsheet waveform, size %zd\n", fw_entry->size);
|
||||||
|
|
||||||
return len;
|
err = len;
|
||||||
|
|
||||||
|
err_fw:
|
||||||
|
release_firmware(fw_entry);
|
||||||
err_failed:
|
err_failed:
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user