aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorWenwen Wang <wenwen@cs.uga.edu>2019-08-17 03:14:54 -0300
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-08-26 10:40:17 -0300
commit725a28290a53bcc02a3de1c1bf64a416d567b283 (patch)
tree1f2cb7c05f241268c1dbb2c279dff58d643e9072 /drivers/media
parentmedia: cpia2_usb: fix memory leaks (diff)
downloadlinux-dev-725a28290a53bcc02a3de1c1bf64a416d567b283.tar.xz
linux-dev-725a28290a53bcc02a3de1c1bf64a416d567b283.zip
media: usb: cx231xx-417: fix a memory leak bug
In cx231xx_load_firmware(), 'p_buffer' is allocated through vmalloc() to hold the firmware. However, after the usage, it is not deallocated, leading to a memory leak bug. Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-417.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/media/usb/cx231xx/cx231xx-417.c b/drivers/media/usb/cx231xx/cx231xx-417.c
index 30624376679b..6d218a036966 100644
--- a/drivers/media/usb/cx231xx/cx231xx-417.c
+++ b/drivers/media/usb/cx231xx/cx231xx-417.c
@@ -1051,6 +1051,7 @@ static int cx231xx_load_firmware(struct cx231xx *dev)
p_current_fw = p_fw;
vfree(p_current_fw);
p_current_fw = NULL;
+ vfree(p_buffer);
uninitGPIO(dev);
release_firmware(firmware);
dprintk(1, "Firmware upload successful.\n");