mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shuah Khan <shuahkh@osg.samsung.com>
To: Alexey Khoroshilov <khoroshilov@ispras.ru>,
	Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	ldv-project@linuxtesting.org,
	Shuah Khan <shuahkh@osg.samsung.com>
Subject: Re: [PATCH] [media] au0828: fix double free in au0828_usb_probe()
Date: Mon, 25 Apr 2016 08:20:49 -0600	[thread overview]
Message-ID: <571E27C1.8020907@osg.samsung.com> (raw)
In-Reply-To: <1461362707-6883-1-git-send-email-khoroshilov@ispras.ru>

On 04/22/2016 04:05 PM, Alexey Khoroshilov wrote:
> In case of failure au0828_v4l2_device_register() deallocates dev
> and returns error code to au0828_usb_probe(), which also
> calls kfree(dev) on a failure path.
> 
> The patch removes duplicated code from au0828_v4l2_device_register().
> 
> Found by Linux Driver Verification project (linuxtesting.org).
> 
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>

I sent a fix in for this a few weeks ago:

https://lkml.org/lkml/2016/3/28/453

thanks,
-- Shuah

> ---
>  drivers/media/usb/au0828/au0828-video.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c
> index 32d7db96479c..7d0ec4cb248c 100644
> --- a/drivers/media/usb/au0828/au0828-video.c
> +++ b/drivers/media/usb/au0828/au0828-video.c
> @@ -679,8 +679,6 @@ int au0828_v4l2_device_register(struct usb_interface *interface,
>  	if (retval) {
>  		pr_err("%s() v4l2_device_register failed\n",
>  		       __func__);
> -		mutex_unlock(&dev->lock);
> -		kfree(dev);
>  		return retval;
>  	}
>  
> @@ -691,8 +689,6 @@ int au0828_v4l2_device_register(struct usb_interface *interface,
>  	if (retval) {
>  		pr_err("%s() v4l2_ctrl_handler_init failed\n",
>  		       __func__);
> -		mutex_unlock(&dev->lock);
> -		kfree(dev);
>  		return retval;
>  	}
>  	dev->v4l2_dev.ctrl_handler = &dev->v4l2_ctrl_hdl;
> 

      reply	other threads:[~2016-04-25 14:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-22 22:05 Alexey Khoroshilov
2016-04-25 14:20 ` Shuah Khan [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=571E27C1.8020907@osg.samsung.com \
    --to=shuahkh@osg.samsung.com \
    --cc=khoroshilov@ispras.ru \
    --cc=ldv-project@linuxtesting.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@osg.samsung.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

all inboxes | Powered by JetHome®