mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 15:49:17 -04:00
media: dvb-frontends: fix a memory leak bug
In cx24117_load_firmware(), 'buf' is allocated through kmalloc() to hold the firmware. However, if i2c_transfer() fails, it is not deallocated, leading to a memory leak bug. Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
parent
8c3d3cdbd5
commit
2f6451ed8b
1 changed files with 3 additions and 1 deletions
|
|
@ -619,8 +619,10 @@ static int cx24117_load_firmware(struct dvb_frontend *fe,
|
|||
|
||||
/* send fw */
|
||||
ret = i2c_transfer(state->priv->i2c, &msg, 1);
|
||||
if (ret < 0)
|
||||
if (ret < 0) {
|
||||
kfree(buf);
|
||||
return ret;
|
||||
}
|
||||
|
||||
kfree(buf);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue