All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: r8192U_core: Remove unnecessary check
@ 2015-03-28 20:53 Ioana Ciornei
  2015-03-28 21:01 ` [Outreachy kernel] " Julia Lawall
  2015-04-01 15:30 ` Greg KH
  0 siblings, 2 replies; 4+ messages in thread
From: Ioana Ciornei @ 2015-03-28 20:53 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Ioana Ciornei

Remove unnecessary check since kfree() handles NULL pointers fine.

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
---
 drivers/staging/rtl8192u/r8192U_core.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
index 8834c23..bce44ba 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -1724,10 +1724,8 @@ static void rtl8192_usb_deleteendpoints(struct net_device *dev)
 	}
 	kfree(priv->oldaddr);
 	priv->oldaddr = NULL;
-	if (priv->pp_rxskb) {
-		kfree(priv->pp_rxskb);
-		priv->pp_rxskb = NULL;
-	}
+	kfree(priv->pp_rxskb);
+	priv->pp_rxskb = NULL;
 }
 #else
 void rtl8192_usb_deleteendpoints(struct net_device *dev)
@@ -1752,11 +1750,8 @@ void rtl8192_usb_deleteendpoints(struct net_device *dev)
 	priv->rx_urb = NULL;
 	kfree(priv->oldaddr);
 	priv->oldaddr = NULL;
-	if (priv->pp_rxskb) {
-		kfree(priv->pp_rxskb);
-		priv->pp_rxskb = 0;
-
-	}
+	kfree(priv->pp_rxskb);
+	priv->pp_rxskb = 0;
 
 #endif
 }
-- 
1.9.1



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

* Re: [Outreachy kernel] [PATCH] staging: r8192U_core: Remove unnecessary check
  2015-03-28 20:53 [PATCH] staging: r8192U_core: Remove unnecessary check Ioana Ciornei
@ 2015-03-28 21:01 ` Julia Lawall
  2015-03-28 21:07   ` Ioana Ciornei
  2015-04-01 15:30 ` Greg KH
  1 sibling, 1 reply; 4+ messages in thread
From: Julia Lawall @ 2015-03-28 21:01 UTC (permalink / raw)
  To: Ioana Ciornei; +Cc: outreachy-kernel

On Sat, 28 Mar 2015, Ioana Ciornei wrote:

> Remove unnecessary check since kfree() handles NULL pointers fine.
> 
> Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
> ---
>  drivers/staging/rtl8192u/r8192U_core.c | 13 ++++---------
>  1 file changed, 4 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
> index 8834c23..bce44ba 100644
> --- a/drivers/staging/rtl8192u/r8192U_core.c
> +++ b/drivers/staging/rtl8192u/r8192U_core.c
> @@ -1724,10 +1724,8 @@ static void rtl8192_usb_deleteendpoints(struct net_device *dev)
>  	}
>  	kfree(priv->oldaddr);
>  	priv->oldaddr = NULL;
> -	if (priv->pp_rxskb) {
> -		kfree(priv->pp_rxskb);
> -		priv->pp_rxskb = NULL;
> -	}
> +	kfree(priv->pp_rxskb);
> +	priv->pp_rxskb = NULL;
>  }
>  #else
>  void rtl8192_usb_deleteendpoints(struct net_device *dev)
> @@ -1752,11 +1750,8 @@ void rtl8192_usb_deleteendpoints(struct net_device *dev)
>  	priv->rx_urb = NULL;
>  	kfree(priv->oldaddr);
>  	priv->oldaddr = NULL;
> -	if (priv->pp_rxskb) {
> -		kfree(priv->pp_rxskb);
> -		priv->pp_rxskb = 0;
> -
> -	}
> +	kfree(priv->pp_rxskb);
> +	priv->pp_rxskb = 0;

I guess it should be a separate change, but since priv->pp_rxskb is an 
argument to kfree it presumably has pointer type, and thus 0 should be 
NULL like in the other assignments above.

julia


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

* Re: [Outreachy kernel] [PATCH] staging: r8192U_core: Remove unnecessary check
  2015-03-28 21:01 ` [Outreachy kernel] " Julia Lawall
@ 2015-03-28 21:07   ` Ioana Ciornei
  0 siblings, 0 replies; 4+ messages in thread
From: Ioana Ciornei @ 2015-03-28 21:07 UTC (permalink / raw)
  To: Julia Lawall; +Cc: outreachy-kernel

[-- Attachment #1: Type: text/plain, Size: 1670 bytes --]

On Sat, Mar 28, 2015 at 11:01 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> On Sat, 28 Mar 2015, Ioana Ciornei wrote:
>
>> Remove unnecessary check since kfree() handles NULL pointers fine.
>>
>> Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
>> ---
>>  drivers/staging/rtl8192u/r8192U_core.c | 13 ++++---------
>>  1 file changed, 4 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/staging/rtl8192u/r8192U_core.c
b/drivers/staging/rtl8192u/r8192U_core.c
>> index 8834c23..bce44ba 100644
>> --- a/drivers/staging/rtl8192u/r8192U_core.c
>> +++ b/drivers/staging/rtl8192u/r8192U_core.c
>> @@ -1724,10 +1724,8 @@ static void rtl8192_usb_deleteendpoints(struct
net_device *dev)
>>       }
>>       kfree(priv->oldaddr);
>>       priv->oldaddr = NULL;
>> -     if (priv->pp_rxskb) {
>> -             kfree(priv->pp_rxskb);
>> -             priv->pp_rxskb = NULL;
>> -     }
>> +     kfree(priv->pp_rxskb);
>> +     priv->pp_rxskb = NULL;
>>  }
>>  #else
>>  void rtl8192_usb_deleteendpoints(struct net_device *dev)
>> @@ -1752,11 +1750,8 @@ void rtl8192_usb_deleteendpoints(struct
net_device *dev)
>>       priv->rx_urb = NULL;
>>       kfree(priv->oldaddr);
>>       priv->oldaddr = NULL;
>> -     if (priv->pp_rxskb) {
>> -             kfree(priv->pp_rxskb);
>> -             priv->pp_rxskb = 0;
>> -
>> -     }
>> +     kfree(priv->pp_rxskb);
>> +     priv->pp_rxskb = 0;
>
> I guess it should be a separate change, but since priv->pp_rxskb is an
> argument to kfree it presumably has pointer type, and thus 0 should be
> NULL like in the other assignments above.
>
> julia


I noticed that too but saved it for another patch. I will send it too.

Ioana

[-- Attachment #2: Type: text/html, Size: 2316 bytes --]

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

* Re: [Outreachy kernel] [PATCH] staging: r8192U_core: Remove unnecessary check
  2015-03-28 20:53 [PATCH] staging: r8192U_core: Remove unnecessary check Ioana Ciornei
  2015-03-28 21:01 ` [Outreachy kernel] " Julia Lawall
@ 2015-04-01 15:30 ` Greg KH
  1 sibling, 0 replies; 4+ messages in thread
From: Greg KH @ 2015-04-01 15:30 UTC (permalink / raw)
  To: Ioana Ciornei; +Cc: outreachy-kernel

On Sat, Mar 28, 2015 at 10:53:24PM +0200, Ioana Ciornei wrote:
> Remove unnecessary check since kfree() handles NULL pointers fine.
> 
> Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
> ---
>  drivers/staging/rtl8192u/r8192U_core.c | 13 ++++---------
>  1 file changed, 4 insertions(+), 9 deletions(-)

You sent me 5 patches for this driver, but no hint as to what order to
apply them in.  Please fix this by resending them as a patch series,
properly numbered and threaded so that I know how to apply them.

thanks,

greg k-h


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

end of thread, other threads:[~2015-04-01 15:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-28 20:53 [PATCH] staging: r8192U_core: Remove unnecessary check Ioana Ciornei
2015-03-28 21:01 ` [Outreachy kernel] " Julia Lawall
2015-03-28 21:07   ` Ioana Ciornei
2015-04-01 15:30 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.