lkml.org 
[lkml]   [2015]   [Aug]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCHv2 12/19] staging: rtl8192u: r8192U_core: fix unnecessary check before kfree code style issue
Date
kfree(NULL) is safe and the checks were not required.

Signed-off-by: Raphaël Beamonte <raphael.beamonte@gmail.com>
---
drivers/staging/rtl8192u/r8192U_core.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
index cd14c0a..d0020f1 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -1724,10 +1724,9 @@ 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 +1751,9 @@ 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
}
--
2.1.4


\
 
 \ /
  Last update: 2015-08-18 19:01    [W:0.562 / U:0.644 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site