lkml.org 
[lkml]   [2019]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] media: dvb: Fix memory leak in af9005_identify_state
Date
In the implementation of af9005_identify_state() there is a memory leak
when checking the reply of af9005_boot_packet(). Go to error path to
release buf.

Fixes: af4e067e1dcf ("V4L/DVB (5625): Add support for the AF9005 demodulator from Afatech")
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
---
drivers/media/usb/dvb-usb/af9005.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/media/usb/dvb-usb/af9005.c b/drivers/media/usb/dvb-usb/af9005.c
index 02697d86e8c1..cfaf630be4d8 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
- return -EIO;
+ else {
+ ret = -EIO;
+ goto err;
+ }
deb_info("Identify state cold = %d\n", *cold);

err:
--
2.17.1
\
 
 \ /
  Last update: 2019-10-27 23:25    [W:0.029 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site