From: Sean Young <sean@mess.org>
To: Navid Emamdoost <navid.emamdoost@gmail.com>
Cc: emamd001@umn.edu, kjlu@umn.edu, smccaman@umn.edu,
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: Re: [PATCH] media: dvb: Fix memory leak in af9005_identify_state
Date: Mon, 28 Oct 2019 09:50:54 +0000 [thread overview]
Message-ID: <20191028095054.GB25747@gofer.mess.org> (raw)
In-Reply-To: <20191027222438.16208-1-navid.emamdoost@gmail.com>
On Sun, Oct 27, 2019 at 05:24:35PM -0500, Navid Emamdoost wrote:
> 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>
Thank you for the patch.
Unfortunately a similar patch is already merged:
https://git.linuxtv.org/media_tree.git/commit/?id=2289adbfa559050d2a38bcd9caac1c18b800e928
Sean
> ---
> 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
prev parent reply other threads:[~2019-10-28 9:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-27 22:24 Navid Emamdoost
2019-10-28 9:50 ` Sean Young [this message]
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=20191028095054.GB25747@gofer.mess.org \
--to=sean@mess.org \
--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=navid.emamdoost@gmail.com \
--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®