From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Kangjie Lu <kjlu@umn.edu>
Cc: pakki001@umn.edu, Colin Ian King <colin.king@canonical.com>,
Jia-Ju Bai <baijiaju1990@gmail.com>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: usb: u132-hcd: fix potential NULL pointer dereference
Date: Tue, 26 Mar 2019 13:41:32 +0900 [thread overview]
Message-ID: <20190326044132.GA19677@kroah.com> (raw)
On Tue, Mar 19, 2019 at 12:34:06PM -0500, Kangjie Lu wrote:
> In case create_singlethread_workqueue fails, the fix notifies
> callers the error to avoid potential NULL pointer dereferences.
>
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
> ---
> removed "unlikely"
> ---
> drivers/usb/host/u132-hcd.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c
> index 934584f0a20a..6d5b532b03f8 100644
> --- a/drivers/usb/host/u132-hcd.c
> +++ b/drivers/usb/host/u132-hcd.c
> @@ -3203,6 +3203,8 @@ static int __init u132_hcd_init(void)
> return -ENODEV;
> printk(KERN_INFO "driver %s\n", hcd_name);
> workqueue = create_singlethread_workqueue("u132");
> + if (!workqueue)
> + return -ENOMEM;
> retval = platform_driver_register(&u132_platform_driver);
> return retval;
if platform_driver_register() fails, shouldn't you clean up the
workqueue? That can be a separate patch, that's not your fault here :)
thanks,
greg k-h
next reply other threads:[~2019-03-26 4:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-26 4:41 Greg Kroah-Hartman [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-03-27 13:57 usb: u132-hcd: fix potential NULL pointer dereference Mukesh Ojha
2019-03-19 17:34 Kangjie Lu
2019-03-19 17:20 Kangjie Lu
2019-03-19 13:56 Greg Kroah-Hartman
2019-03-14 7:27 Kangjie Lu
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=20190326044132.GA19677@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=baijiaju1990@gmail.com \
--cc=colin.king@canonical.com \
--cc=kjlu@umn.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=pakki001@umn.edu \
/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;
as well as URLs for NNTP newsgroup(s).