From: Eli Billauer <eli.billauer@gmail.com>
To: Richard Weinberger <richard@nod.at>
Cc: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging/xillybus: Handle OOM in xillybus_init()
Date: Wed, 19 Mar 2014 01:18:37 +0200 [thread overview]
Message-ID: <5328D44D.9060509@gmail.com> (raw)
In-Reply-To: <1395184025-17278-1-git-send-email-richard@nod.at>
Hi,
I stand (shamefully) corrected. Thanks.
Eli
On 19/03/14 01:07, Richard Weinberger wrote:
> alloc_workqueue() can fail and returns NULL in case of
> OOM.
> Handle this case and undo class_create().
>
> Signed-off-by: Richard Weinberger<richard@nod.at>
> ---
> drivers/staging/xillybus/xillybus_core.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/xillybus/xillybus_core.c b/drivers/staging/xillybus/xillybus_core.c
> index 2ebaf16..b0a6696 100644
> --- a/drivers/staging/xillybus/xillybus_core.c
> +++ b/drivers/staging/xillybus/xillybus_core.c
> @@ -2318,8 +2318,12 @@ static int __init xillybus_init(void)
> }
>
> xillybus_wq = alloc_workqueue(xillyname, 0, 0);
> + if (!xillybus_wq) {
> + class_destroy(xillybus_class);
> + rc = -ENOMEM;
> + }
>
> - return 0; /* Success */
> + return rc;
> }
>
> static void __exit xillybus_exit(void)
>
prev parent reply other threads:[~2014-03-18 23:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-18 23:07 Richard Weinberger
2014-03-18 23:18 ` 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=5328D44D.9060509@gmail.com \
--to=eli.billauer@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=richard@nod.at \
/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