aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Engelmayer <cengelma@gmx.at>2015-10-23 17:26:18 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-11-19 06:16:10 -0500
commitb771852270499d760825ebad894498b8059355a4 (patch)
tree664441a7292d29d791d905293f70709cc3b435a6
parent2ff56fadd94cdaeeaeccbc0a9b703a0101ada128 (diff)
[media] as102: fix potential double free in as102_fw_upload()
In case the request to locate the firmware file part 2 fails, the error path releases the already freed firmware memory location again. Thus reset the firmware pointer to NULL after releasing firmware file part 1. Signed-off-by: Christian Engelmayer <cengelma@gmx.at> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r--drivers/media/usb/as102/as102_fw.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/media/usb/as102/as102_fw.c b/drivers/media/usb/as102/as102_fw.c
index 07d08c49f4d4..5a28ce3a1d49 100644
--- a/drivers/media/usb/as102/as102_fw.c
+++ b/drivers/media/usb/as102/as102_fw.c
@@ -198,6 +198,7 @@ int as102_fw_upload(struct as10x_bus_adapter_t *bus_adap)
198 pr_info("%s: firmware: %s loaded with success\n", 198 pr_info("%s: firmware: %s loaded with success\n",
199 DRIVER_NAME, fw1); 199 DRIVER_NAME, fw1);
200 release_firmware(firmware); 200 release_firmware(firmware);
201 firmware = NULL;
201 202
202 /* wait for boot to complete */ 203 /* wait for boot to complete */
203 mdelay(100); 204 mdelay(100);