From: Xiaochen Wang <wangxiaochen0@gmail.com>
To: greg@kroah.com, Larry.Finger@lwfinger.net,
florian.c.schilhabel@googlemail.com,
linux-kernel@vger.kernel.org
Subject: [PATCH] check _malloc return value in rtl8712
Date: Sun, 6 Mar 2011 22:53:21 +0800 [thread overview]
Message-ID: <20110306145321.GA20485@chii> (raw)
Description: The original check is wrong.
Signed-off-by: Xiaochen Wang <wangxiaochen0@gmail.com>
---
drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
index 685a7b1..51fef02 100644
--- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
+++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
@@ -953,7 +953,7 @@ static int r871x_wx_set_priv(struct net_device *dev,
len = dwrq->length;
ext = _malloc(len);
- if (!_malloc(len))
+ if (!ext)
return -ENOMEM;
if (copy_from_user(ext, dwrq->pointer, len)) {
kfree(ext);
--
1.7.2.3
next reply other threads:[~2011-03-06 14:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-06 14:53 Xiaochen Wang [this message]
2011-03-06 16:48 ` [PATCH] check _malloc return value in rtl8712 Larry Finger
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=20110306145321.GA20485@chii \
--to=wangxiaochen0@gmail.com \
--cc=Larry.Finger@lwfinger.net \
--cc=florian.c.schilhabel@googlemail.com \
--cc=greg@kroah.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