From: Christian Engelmayer Date: Fri, 23 Oct 2015 21:26:18 +0000 (-0200) Subject: [media] as102: fix potential double free in as102_fw_upload() X-Git-Tag: android-x86-7.1-r1~2289^2~292 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=b771852270499d760825ebad894498b8059355a4;p=android-x86%2Fkernel.git [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 Signed-off-by: Mauro Carvalho Chehab --- 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) pr_info("%s: firmware: %s loaded with success\n", DRIVER_NAME, fw1); release_firmware(firmware); + firmware = NULL; /* wait for boot to complete */ mdelay(100);