Skip to content

Commit

Permalink
staging: rtl8712: check _malloc return value
Browse files Browse the repository at this point in the history
Description: The original check is wrong.

Signed-off-by: Xiaochen Wang <wangxiaochen0@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Xiaochen Wang authored and Greg Kroah-Hartman committed Mar 7, 2011
1 parent cd92274 commit 4495c15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/rtl8712/rtl871x_ioctl_linux.c
Original file line number Diff line number Diff line change
@@ -958,7 +958,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);

0 comments on commit 4495c15

Please sign in to comment.