[PATCH] check _malloc return value in rtl8712

From: Xiaochen Wang
Date: Sun Mar 06 2011 - 09:49:44 EST


Description: The original check is wrong.

Signed-off-by: Xiaochen Wang <wangxiaochen0@xxxxxxxxx>
---
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/