This is an automatic generated email to let you know that the following patch 
were queued:

Subject: media: dvb-frontends: fix a memory leak bug
Author:  Wenwen Wang <wen...@cs.uga.edu>
Date:    Sat Aug 17 04:04:04 2019 -0300

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 <wen...@cs.uga.edu>
Signed-off-by: Sean Young <s...@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+sams...@kernel.org>

 drivers/media/dvb-frontends/cx24117.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

---

diff --git a/drivers/media/dvb-frontends/cx24117.c 
b/drivers/media/dvb-frontends/cx24117.c
index 42697a5999f7..9fccc906d85a 100644
--- a/drivers/media/dvb-frontends/cx24117.c
+++ b/drivers/media/dvb-frontends/cx24117.c
@@ -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);
 

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to