Skip to content

Commit

Permalink
media: usb: cx231xx-417: fix a memory leak bug
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
wenwenwang1 authored and mchehab committed Aug 26, 2019
1 parent 1c770f0 commit 725a282
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/media/usb/cx231xx/cx231xx-417.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 725a282

Please sign in to comment.