Commit 40083865 authored by Alexander Beregalov's avatar Alexander Beregalov Committed by Greg Kroah-Hartman

Staging: rtl8712: redundant null check before kfree()

Signed-off-by: default avatarAlexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent cc614b69
...@@ -431,8 +431,7 @@ u8 r8712_joinbss_cmd(struct _adapter *padapter, struct wlan_network *pnetwork) ...@@ -431,8 +431,7 @@ u8 r8712_joinbss_cmd(struct _adapter *padapter, struct wlan_network *pnetwork)
} }
psecnetwork = (struct ndis_wlan_bssid_ex *)&psecuritypriv->sec_bss; psecnetwork = (struct ndis_wlan_bssid_ex *)&psecuritypriv->sec_bss;
if (psecnetwork == NULL) { if (psecnetwork == NULL) {
if (pcmd != NULL) kfree(pcmd);
kfree((unsigned char *)pcmd);
return _FAIL; return _FAIL;
} }
memset(psecnetwork, 0, t_len); memset(psecnetwork, 0, t_len);
......
...@@ -73,8 +73,7 @@ static uint _init_intf_hdl(struct _adapter *padapter, ...@@ -73,8 +73,7 @@ static uint _init_intf_hdl(struct _adapter *padapter,
goto _init_intf_hdl_fail; goto _init_intf_hdl_fail;
return _SUCCESS; return _SUCCESS;
_init_intf_hdl_fail: _init_intf_hdl_fail:
if (pintf_priv) kfree(pintf_priv);
kfree((u8 *)pintf_priv);
return _FAIL; return _FAIL;
} }
...@@ -84,8 +83,7 @@ static void _unload_intf_hdl(struct intf_priv *pintfpriv) ...@@ -84,8 +83,7 @@ static void _unload_intf_hdl(struct intf_priv *pintfpriv)
unload_intf_priv = &r8712_usb_unload_intf_priv; unload_intf_priv = &r8712_usb_unload_intf_priv;
unload_intf_priv(pintfpriv); unload_intf_priv(pintfpriv);
if (pintfpriv) kfree(pintfpriv);
kfree((u8 *)pintfpriv);
} }
static uint register_intf_hdl(u8 *dev, struct intf_hdl *pintfhdl) static uint register_intf_hdl(u8 *dev, struct intf_hdl *pintfhdl)
......
...@@ -1732,8 +1732,7 @@ static int r871x_wx_set_enc_ext(struct net_device *dev, ...@@ -1732,8 +1732,7 @@ static int r871x_wx_set_enc_ext(struct net_device *dev,
memcpy(param + 1, pext + 1, pext->key_len); memcpy(param + 1, pext + 1, pext->key_len);
} }
ret = wpa_set_encryption(dev, param, param_len); ret = wpa_set_encryption(dev, param, param_len);
if (param) kfree(param);
kfree((u8 *)param);
return ret; return ret;
} }
......
...@@ -274,8 +274,7 @@ void r8712_SetChannel(struct _adapter *pAdapter) ...@@ -274,8 +274,7 @@ void r8712_SetChannel(struct _adapter *pAdapter)
pparm = (struct SetChannel_parm *)_malloc(sizeof(struct pparm = (struct SetChannel_parm *)_malloc(sizeof(struct
SetChannel_parm)); SetChannel_parm));
if (pparm == NULL) { if (pparm == NULL) {
if (pcmd != NULL) kfree(pcmd);
kfree((u8 *)pcmd);
return; return;
} }
pparm->curr_ch = pAdapter->mppriv.curr_ch; pparm->curr_ch = pAdapter->mppriv.curr_ch;
......
...@@ -996,8 +996,7 @@ static void free_hwxmits(struct _adapter *padapter) ...@@ -996,8 +996,7 @@ static void free_hwxmits(struct _adapter *padapter)
{ {
struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
if (pxmitpriv->hwxmits) kfree(pxmitpriv->hwxmits);
kfree((u8 *)pxmitpriv->hwxmits);
} }
static void init_hwxmits(struct hw_xmit *phwxmit, sint entry) static void init_hwxmits(struct hw_xmit *phwxmit, sint entry)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment