mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sean Young <sean@mess.org>
To: Jiri Slaby <jslaby@suse.cz>
Cc: jirislaby@gmail.com, linux-kernel@vger.kernel.org,
	Mauro Carvalho Chehab <mchehab@redhat.com>,
	linux-media@vger.kernel.org
Subject: Re: [PATCH 2/5] MEDIA: ttusbir, fix double free
Date: Tue, 9 Apr 2013 11:36:53 +0100	[thread overview]
Message-ID: <20130409103653.GA15828@pequod.mess.org> (raw)
In-Reply-To: <1365107532-32721-2-git-send-email-jslaby@suse.cz>

On Thu, Apr 04, 2013 at 10:32:09PM +0200, Jiri Slaby wrote:
> rc_unregister_device already calls rc_free_device to free the passed
> device. But in one of ttusbir's probe fail paths, we call
> rc_unregister_device _and_ rc_free_device. This is wrong and results
> in a double free.
> 
> Instead, set rc to NULL resulting in rc_free_device being a noop.
> 
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> Cc: Sean Young <sean@mess.org>
> Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
> Cc: linux-media@vger.kernel.org
> ---
>  drivers/media/rc/ttusbir.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/media/rc/ttusbir.c b/drivers/media/rc/ttusbir.c
> index cf0d47f..891762d 100644
> --- a/drivers/media/rc/ttusbir.c
> +++ b/drivers/media/rc/ttusbir.c
> @@ -347,6 +347,7 @@ static int ttusbir_probe(struct usb_interface *intf,
>  	return 0;
>  out3:
>  	rc_unregister_device(rc);
> +	rc = NULL;
>  out2:
>  	led_classdev_unregister(&tt->led);
>  out:
> -- 

Acked-by: Sean Young <sean@mess.org>


Sean

  reply	other threads:[~2013-04-09 10:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-04 20:32 [PATCH 1/5] BLOCK: rbd, return proper error from rbd_dev_probe_update_spec Jiri Slaby
2013-04-04 20:32 ` [PATCH 2/5] MEDIA: ttusbir, fix double free Jiri Slaby
2013-04-09 10:36   ` Sean Young [this message]
2013-04-04 20:32 ` [PATCH 3/5] SOUND: hda_generic, fix uninitialized variable Jiri Slaby
2013-04-05  5:20   ` Takashi Iwai
2013-04-04 20:32 ` [PATCH 4/5] X86: boot, close opened descriptor Jiri Slaby
2013-04-04 20:32 ` [PATCH 5/5] HID: hid-lenovo-tpkbd, remove doubled hid_get_drvdata Jiri Slaby
2013-04-04 22:37   ` Jiri Kosina
2013-04-04 23:05   ` Nikola Pajkovsky
2013-04-04 22:53 ` [PATCH 1/5] BLOCK: rbd, return proper error from rbd_dev_probe_update_spec Nikola Pajkovsky

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=20130409103653.GA15828@pequod.mess.org \
    --to=sean@mess.org \
    --cc=jirislaby@gmail.com \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.com \
    /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

Powered by JetHome