staging: rtl8712: check _malloc return value
authorXiaochen Wang <wangxiaochen0@gmail.com>
Sun, 6 Mar 2011 14:53:21 +0000 (22:53 +0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 7 Mar 2011 21:46:38 +0000 (13:46 -0800)
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>
drivers/staging/rtl8712/rtl871x_ioctl_linux.c

index 4ac17c0bbd59dd1af2912c4588efde68c30bdc1d..8ebfdd620ba4f8b86ada4fe7944589edca30f4d3 100644 (file)
@@ -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);