From: Xiaochen Wang Date: Sun, 6 Mar 2011 14:53:21 +0000 (+0800) Subject: staging: rtl8712: check _malloc return value X-Git-Tag: firefly_0821_release~7613^2~2197^2~241 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4495c15f29a11c41d0a69a6e848307b0db7cc196;p=firefly-linux-kernel-4.4.55.git staging: rtl8712: check _malloc return value Description: The original check is wrong. Signed-off-by: Xiaochen Wang Acked-by: Larry Finger Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c index 4ac17c0bbd59..8ebfdd620ba4 100644 --- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c +++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c @@ -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);