From: Eli Billauer <eli.billauer@gmail.com>
To: Hangyu Hua <hbh25y@gmail.com>
Cc: arnd@arndb.de, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] char: xillybus: fix a refcount leak in cleanup_dev()
Date: Wed, 06 Apr 2022 18:17:28 +0300 [thread overview]
Message-ID: <624DAF08.9080304@gmail.com> (raw)
In-Reply-To: <20220406075703.23464-1-hbh25y@gmail.com>
I stand corrected. Thanks a lot.
Eli
Acked-by: Eli Billauer <eli.billauer@gmail.com>
On 06/04/22 10:57, Hangyu Hua wrote:
> usb_get_dev is called in xillyusb_probe. So it is better to call
> usb_put_dev before xdev is released.
>
> Signed-off-by: Hangyu Hua<hbh25y@gmail.com>
> ---
> drivers/char/xillybus/xillyusb.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/char/xillybus/xillyusb.c b/drivers/char/xillybus/xillyusb.c
> index dc3551796e5e..39bcbfd908b4 100644
> --- a/drivers/char/xillybus/xillyusb.c
> +++ b/drivers/char/xillybus/xillyusb.c
> @@ -549,6 +549,7 @@ static void cleanup_dev(struct kref *kref)
> if (xdev->workq)
> destroy_workqueue(xdev->workq);
>
> + usb_put_dev(xdev->udev);
> kfree(xdev->channels); /* Argument may be NULL, and that's fine */
> kfree(xdev);
> }
>
prev parent reply other threads:[~2022-04-06 17:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-06 7:57 [PATCH] char: xillybus: fix a refcount leak in cleanup_dev() Hangyu Hua
2022-04-06 15:17 ` Eli Billauer [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=624DAF08.9080304@gmail.com \
--to=eli.billauer@gmail.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=hbh25y@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/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