Commit 400838659314cc67032f35962eee5a8639981b61

Authored by Alexander Beregalov
Committed by Greg Kroah-Hartman
1 parent cc614b6970

Staging: rtl8712: redundant null check before kfree()

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Showing 5 changed files with 6 additions and 12 deletions Side-by-side Diff

drivers/staging/rtl8712/rtl871x_cmd.c
... ... @@ -431,8 +431,7 @@
431 431 }
432 432 psecnetwork = (struct ndis_wlan_bssid_ex *)&psecuritypriv->sec_bss;
433 433 if (psecnetwork == NULL) {
434   - if (pcmd != NULL)
435   - kfree((unsigned char *)pcmd);
  434 + kfree(pcmd);
436 435 return _FAIL;
437 436 }
438 437 memset(psecnetwork, 0, t_len);
drivers/staging/rtl8712/rtl871x_io.c
... ... @@ -73,8 +73,7 @@
73 73 goto _init_intf_hdl_fail;
74 74 return _SUCCESS;
75 75 _init_intf_hdl_fail:
76   - if (pintf_priv)
77   - kfree((u8 *)pintf_priv);
  76 + kfree(pintf_priv);
78 77 return _FAIL;
79 78 }
80 79  
... ... @@ -84,8 +83,7 @@
84 83  
85 84 unload_intf_priv = &r8712_usb_unload_intf_priv;
86 85 unload_intf_priv(pintfpriv);
87   - if (pintfpriv)
88   - kfree((u8 *)pintfpriv);
  86 + kfree(pintfpriv);
89 87 }
90 88  
91 89 static uint register_intf_hdl(u8 *dev, struct intf_hdl *pintfhdl)
drivers/staging/rtl8712/rtl871x_ioctl_linux.c
... ... @@ -1732,8 +1732,7 @@
1732 1732 memcpy(param + 1, pext + 1, pext->key_len);
1733 1733 }
1734 1734 ret = wpa_set_encryption(dev, param, param_len);
1735   - if (param)
1736   - kfree((u8 *)param);
  1735 + kfree(param);
1737 1736 return ret;
1738 1737 }
1739 1738  
drivers/staging/rtl8712/rtl871x_mp.c
... ... @@ -274,8 +274,7 @@
274 274 pparm = (struct SetChannel_parm *)_malloc(sizeof(struct
275 275 SetChannel_parm));
276 276 if (pparm == NULL) {
277   - if (pcmd != NULL)
278   - kfree((u8 *)pcmd);
  277 + kfree(pcmd);
279 278 return;
280 279 }
281 280 pparm->curr_ch = pAdapter->mppriv.curr_ch;
drivers/staging/rtl8712/rtl871x_xmit.c
... ... @@ -996,8 +996,7 @@
996 996 {
997 997 struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
998 998  
999   - if (pxmitpriv->hwxmits)
1000   - kfree((u8 *)pxmitpriv->hwxmits);
  999 + kfree(pxmitpriv->hwxmits);
1001 1000 }
1002 1001  
1003 1002 static void init_hwxmits(struct hw_xmit *phwxmit, sint entry)