From: Greg KH <gregkh@linuxfoundation.org>
To: Madhumitha Prabakaran <madhumithabiw@gmail.com>
Cc: outreachy-kernel@googlegroups.com
Subject: Re: [PATCH 7/7] Staging: rtl8723bs: Add missing NULL check for kmalloc
Date: Sun, 17 Mar 2019 11:55:56 +0100 [thread overview]
Message-ID: <20190317105556.GG16257@kroah.com> (raw)
In-Reply-To: <9e935823819d846fd331aa188f69ce295deb4ca2.1552782299.git.madhumithabiw@gmail.com>
On Sat, Mar 16, 2019 at 07:32:24PM -0500, Madhumitha Prabakaran wrote:
> Include missing NULL check for kmalloc in function rtw_init_evt_priv.
>
> Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com>
> ---
> drivers/staging/rtl8723bs/core/rtw_cmd.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
> index 2890e12f6fb1..4ea6483f4634 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
> @@ -213,6 +213,8 @@ int rtw_init_evt_priv(struct evt_priv *pevtpriv)
> pevtpriv->c2h_wk_alive = false;
> pevtpriv->c2h_queue = rtw_cbuf_alloc(C2H_QUEUE_MAX_LEN+1);
>
> + if (!pevtpriv->c2h_queue)
> + return -ENOMEM;
> return res;
This is good, but if you notice, there is no need for 'res' in this
function at all, you can just return 0 for it, right?
So in the earlier patches in this series, you could just drop the local
variable completly, making this a bit simpler to do.
thanks,
greg k-h
next prev parent reply other threads:[~2019-03-17 10:56 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-17 0:32 [PATCH 0/7] Issue suggested by Coccinelle using ret.cocci Madhumitha Prabakaran
2019-03-17 0:32 ` [PATCH 1/7] Staging: rtl8723bs: Drop wrappers and change function names Madhumitha Prabakaran
2019-03-17 10:59 ` Greg KH
2019-03-17 0:32 ` [PATCH 2/7] Staging: rtl8723bs: Convert type of local variables and return types Madhumitha Prabakaran
2019-03-17 6:42 ` [Outreachy kernel] " Julia Lawall
2019-03-17 0:32 ` [PATCH 3/7] Staging: rtl8723bs: Change values of error codes in functions Madhumitha Prabakaran
2019-03-17 6:38 ` [Outreachy kernel] " Julia Lawall
2019-03-17 0:32 ` [PATCH 4/7] Staging: rtl8723bs: Remove unnecessary function declarations Madhumitha Prabakaran
2019-03-17 6:34 ` [Outreachy kernel] " Julia Lawall
2019-03-17 0:32 ` [PATCH 5/7] Staging: rtl8723bs: Replace error codes with values Madhumitha Prabakaran
2019-03-17 6:33 ` [Outreachy kernel] " Julia Lawall
2019-03-17 0:32 ` [PATCH 6/7] Staging: rtl8723bs: Remove extern and change return type Madhumitha Prabakaran
2019-03-17 6:29 ` [Outreachy kernel] " Julia Lawall
2019-03-17 6:30 ` Julia Lawall
2019-03-17 0:32 ` [PATCH 7/7] Staging: rtl8723bs: Add missing NULL check for kmalloc Madhumitha Prabakaran
2019-03-17 10:55 ` Greg KH [this message]
2019-03-17 6:43 ` [Outreachy kernel] [PATCH 0/7] Issue suggested by Coccinelle using ret.cocci Julia Lawall
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=20190317105556.GG16257@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=madhumithabiw@gmail.com \
--cc=outreachy-kernel@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.