From 4495c15f29a11c41d0a69a6e848307b0db7cc196 Mon Sep 17 00:00:00 2001 From: Xiaochen Wang Date: Sun, 6 Mar 2011 22:53:21 +0800 Subject: [PATCH] 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 --- drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.20.1