[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190913235505.9164-1-navid.emamdoost@gmail.com>
Date: Fri, 13 Sep 2019 18:55:02 -0500
From: Navid Emamdoost <navid.emamdoost@...il.com>
To: unlisted-recipients:; (no To-header on input)
Cc: emamd001@....edu, smccaman@....edu, kjlu@....edu,
Navid Emamdoost <navid.emamdoost@...il.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Richard Fontana <rfontana@...hat.com>,
Kate Stewart <kstewart@...uxfoundation.org>,
linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] media: usb: fix memory leak in af9005_identify_state
In af9005_identify_state when returning -EIO the allocated buffer should
be released.
Signed-off-by: Navid Emamdoost <navid.emamdoost@...il.com>
---
drivers/media/usb/dvb-usb/af9005.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/media/usb/dvb-usb/af9005.c b/drivers/media/usb/dvb-usb/af9005.c
index 02697d86e8c1..aee500beaab6 100644
--- a/drivers/media/usb/dvb-usb/af9005.c
+++ b/drivers/media/usb/dvb-usb/af9005.c
@@ -975,8 +975,10 @@ static int af9005_identify_state(struct usb_device *udev,
*cold = 1;
else if (reply == 0x02)
*cold = 0;
- else
+ else {
+ kfree(buf);
return -EIO;
+ }
deb_info("Identify state cold = %d\n", *cold);
err:
--
2.17.1
Powered by blists - more mailing lists