提交 725a2829 编写于 作者: W Wenwen Wang 提交者: Mauro Carvalho Chehab

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: NWenwen Wang <wenwen@cs.uga.edu>
Signed-off-by: NHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
上级 1c770f0f
...@@ -1051,6 +1051,7 @@ static int cx231xx_load_firmware(struct cx231xx *dev) ...@@ -1051,6 +1051,7 @@ static int cx231xx_load_firmware(struct cx231xx *dev)
p_current_fw = p_fw; p_current_fw = p_fw;
vfree(p_current_fw); vfree(p_current_fw);
p_current_fw = NULL; p_current_fw = NULL;
vfree(p_buffer);
uninitGPIO(dev); uninitGPIO(dev);
release_firmware(firmware); release_firmware(firmware);
dprintk(1, "Firmware upload successful.\n"); dprintk(1, "Firmware upload successful.\n");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册