mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Navid Emamdoost <navid.emamdoost@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: emamd001@umn.edu, kjlu@umn.edu, smccaman@umn.edu,
	Navid Emamdoost <navid.emamdoost@gmail.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Allison Randal <allison@lohutok.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Kate Stewart <kstewart@linuxfoundation.org>,
	Richard Fontana <rfontana@redhat.com>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] media: dvb: Fix memory leak in af9005_identify_state
Date: Sun, 27 Oct 2019 17:24:35 -0500	[thread overview]
Message-ID: <20191027222438.16208-1-navid.emamdoost@gmail.com> (raw)

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


             reply	other threads:[~2019-10-27 22:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-27 22:24 Navid Emamdoost [this message]
2019-10-28  9:50 ` Sean Young

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191027222438.16208-1-navid.emamdoost@gmail.com \
    --to=navid.emamdoost@gmail.com \
    --cc=allison@lohutok.net \
    --cc=emamd001@umn.edu \
    --cc=kjlu@umn.edu \
    --cc=kstewart@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=rfontana@redhat.com \
    --cc=smccaman@umn.edu \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®