From: Greg KH <greg@kroah.com>
To: wzt.wzt@gmail.com
Cc: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, gregkh@suse.de
Subject: Re: [PATCH] Staging: Check kmalloc return value before use the buffer in ieee80211_softmac.c
Date: Wed, 5 May 2010 09:18:56 -0700 [thread overview]
Message-ID: <20100505161856.GA8708@kroah.com> (raw)
In-Reply-To: <20100505065652.GB7495@localhost.localdomain>
On Wed, May 05, 2010 at 02:56:52PM +0800, wzt.wzt@gmail.com wrote:
> Check kmalloc return value before use the buffer.
>
> Signed-off-by: Zhitong Wang <zhitong.wangzt@alibaba-inc.com>
>
> ---
> .../staging/rtl8192u/ieee80211/ieee80211_softmac.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> index 27d9257..8718ac9 100644
> --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> @@ -1579,6 +1579,8 @@ static inline u16 auth_parse(struct sk_buff *skb, u8** challenge, int *chlen)
> if(*(t++) == MFIE_TYPE_CHALLENGE){
> *chlen = *(t++);
> *challenge = (u8*)kmalloc(*chlen, GFP_ATOMIC);
> + if (!*challenge)
> + return -ENOMEM;
Great catch!
thanks for the patch, now queued up.
greg k-h
prev parent reply other threads:[~2010-05-05 16:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-05 6:56 [PATCH] Staging: Check kmalloc return value before use the buffer in ieee80211_softmac.c wzt.wzt
2010-05-05 16:18 ` Greg KH [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=20100505161856.GA8708@kroah.com \
--to=greg@kroah.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=wzt.wzt@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox