public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] check _malloc return value in rtl8712
@ 2011-03-06 14:53 Xiaochen Wang
  2011-03-06 16:48 ` Larry Finger
  0 siblings, 1 reply; 2+ messages in thread
From: Xiaochen Wang @ 2011-03-06 14:53 UTC (permalink / raw)
  To: greg, Larry.Finger, florian.c.schilhabel, linux-kernel

Description: The original check is wrong.

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] check _malloc return value in rtl8712
  2011-03-06 14:53 [PATCH] check _malloc return value in rtl8712 Xiaochen Wang
@ 2011-03-06 16:48 ` Larry Finger
  0 siblings, 0 replies; 2+ messages in thread
From: Larry Finger @ 2011-03-06 16:48 UTC (permalink / raw)
  To: Xiaochen Wang; +Cc: greg, florian.c.schilhabel, linux-kernel

On 03/06/2011 08:53 AM, Xiaochen Wang wrote:
> Description: The original check is wrong.
>
> Signed-off-by: Xiaochen Wang<wangxiaochen0@gmail.com>
> ---
>   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);

ACK.

Larry


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-06 16:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-06 14:53 [PATCH] check _malloc return value in rtl8712 Xiaochen Wang
2011-03-06 16:48 ` Larry Finger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox