From: syzbot <syzbot+b4d54814b339b5c6bbd4@syzkaller.appspotmail.com>
To: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Cc: andriy.shevchenko@linux.intel.com, ezequiel@vanguardiasur.com.ar,
linux-media@vger.kernel.org, linux-usb@vger.kernel.org,
mchehab@kernel.org, royale@zerezo.com,
syzkaller-bugs@googlegroups.com
Subject: Re: Re: [RFT][PATCH v1] media: zr364xx: Fix memory leak in ->probe()
Date: Wed, 30 Dec 2020 17:53:54 -0800 [thread overview]
Message-ID: <00000000000073b51105b7b8e52d@google.com> (raw)
In-Reply-To: <CAAEAJfCiUx+NepjxBvoupShks9MTpN9ihzBywqt0at4ekkFASQ@mail.gmail.com>
> Hey Andy,
>
> Thank you for the patch.
>
> On Wed, 30 Dec 2020 at 18:22, Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
>>
>> When ->probe() fails in some cases it may not free resources.
>> Replace few separated calls by v4l2_device_put() to clean up
>> everything.
>>
>> Reported-by: syzbot+b4d54814b339b5c6bbd4@syzkaller.appspotmail.com
>> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>> ---
>> I have no hardware and hadn't done any test of this.
>>
>
> For bugs with reproducers such as this one, syzbot will test your
> patches really quickly.
> Just push the patch somewhere and then reply to syzbot bug report mail with
>
> #syz test: git://repo/address.git commit-hash
"git://repo/address.git" does not look like a valid git repo address.
>
> You can experiment with syzbot by replying only to syzbot's mail address.
>
> See https://github.com/google/syzkaller/blob/master/docs/syzbot.md#testing-patches
> for more details.
>
> Cheers,
> Ezequiel
>
>
>> drivers/media/usb/zr364xx/zr364xx.c | 4 +---
>> 1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/drivers/media/usb/zr364xx/zr364xx.c b/drivers/media/usb/zr364xx/zr364xx.c
>> index 1e1c6b4d1874..5b9e31af57cf 100644
>> --- a/drivers/media/usb/zr364xx/zr364xx.c
>> +++ b/drivers/media/usb/zr364xx/zr364xx.c
>> @@ -1533,9 +1533,7 @@ static int zr364xx_probe(struct usb_interface *intf,
>> return 0;
>>
>> fail:
>> - v4l2_ctrl_handler_free(hdl);
>> - v4l2_device_unregister(&cam->v4l2_dev);
>> - kfree(cam);
>> + v4l2_device_put(&cam->v4l2_dev);
>> return err;
>> }
>>
>> --
>> 2.29.2
>>
next prev parent reply other threads:[~2020-12-31 1:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-30 21:19 [RFT][PATCH v1] media: zr364xx: Fix memory leak in ->probe() Andy Shevchenko
2020-12-31 1:53 ` Ezequiel Garcia
2020-12-31 1:53 ` syzbot [this message]
2021-01-05 14:00 ` Dan Carpenter
2021-01-05 14:37 ` Andy Shevchenko
2021-01-05 16:04 ` Dan Carpenter
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=00000000000073b51105b7b8e52d@google.com \
--to=syzbot+b4d54814b339b5c6bbd4@syzkaller.appspotmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=ezequiel@vanguardiasur.com.ar \
--cc=linux-media@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=royale@zerezo.com \
--cc=syzkaller-bugs@googlegroups.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.