]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
Staging: rtl8712: redundant null check before kfree()
authorAlexander Beregalov <a.beregalov@gmail.com>
Sat, 26 Mar 2011 17:18:14 +0000 (20:18 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 20 Apr 2011 20:45:59 +0000 (13:45 -0700)
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/rtl8712/rtl871x_cmd.c
drivers/staging/rtl8712/rtl871x_io.c
drivers/staging/rtl8712/rtl871x_ioctl_linux.c
drivers/staging/rtl8712/rtl871x_mp.c
drivers/staging/rtl8712/rtl871x_xmit.c

index fbb2e4eaae5189b10885907482ad9f8f3fb5b480..6b9daa6acbba2be5d5f7175d474121f1b83ff743 100644 (file)
@@ -431,8 +431,7 @@ u8 r8712_joinbss_cmd(struct _adapter  *padapter, struct wlan_network *pnetwork)
        }
        psecnetwork = (struct ndis_wlan_bssid_ex *)&psecuritypriv->sec_bss;
        if (psecnetwork == NULL) {
-               if (pcmd != NULL)
-                       kfree((unsigned char *)pcmd);
+               kfree(pcmd);
                return _FAIL;
        }
        memset(psecnetwork, 0, t_len);
index e6e3c3752a9721f8547db8610f21b01547fa17ff..ca84ee02eacc1cb7288ca268ac4cad8945c07c09 100644 (file)
@@ -73,8 +73,7 @@ static uint _init_intf_hdl(struct _adapter *padapter,
                goto _init_intf_hdl_fail;
        return _SUCCESS;
 _init_intf_hdl_fail:
-       if (pintf_priv)
-               kfree((u8 *)pintf_priv);
+       kfree(pintf_priv);
        return _FAIL;
 }
 
@@ -84,8 +83,7 @@ static void _unload_intf_hdl(struct intf_priv *pintfpriv)
 
        unload_intf_priv = &r8712_usb_unload_intf_priv;
        unload_intf_priv(pintfpriv);
-       if (pintfpriv)
-               kfree((u8 *)pintfpriv);
+       kfree(pintfpriv);
 }
 
 static uint register_intf_hdl(u8 *dev, struct intf_hdl *pintfhdl)
index bd315c77610adb1fdf4ed3005bd213adf4f76198..f71183a4d04adc1db2d3663749adfeb544d82d37 100644 (file)
@@ -1732,8 +1732,7 @@ static int r871x_wx_set_enc_ext(struct net_device *dev,
                memcpy(param + 1, pext + 1, pext->key_len);
        }
        ret = wpa_set_encryption(dev, param, param_len);
-       if (param)
-               kfree((u8 *)param);
+       kfree(param);
        return ret;
 }
 
index 427467cb10bde866f449cc6c2d53dfadc7204241..3ad47912924eb5bbee4c6b27e01e6c48de975eba 100644 (file)
@@ -274,8 +274,7 @@ void r8712_SetChannel(struct _adapter *pAdapter)
        pparm = (struct SetChannel_parm *)_malloc(sizeof(struct
                                         SetChannel_parm));
        if (pparm == NULL) {
-               if (pcmd != NULL)
-                       kfree((u8 *)pcmd);
+               kfree(pcmd);
                return;
        }
        pparm->curr_ch = pAdapter->mppriv.curr_ch;
index 75f1a6bba2f6c607b347042d57fd64527eacedf2..ccf08911f58b7a91a7560e3a1e4935127f748410 100644 (file)
@@ -996,8 +996,7 @@ static void free_hwxmits(struct _adapter *padapter)
 {
        struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
 
-       if (pxmitpriv->hwxmits)
-               kfree((u8 *)pxmitpriv->hwxmits);
+       kfree(pxmitpriv->hwxmits);
 }
 
 static void init_hwxmits(struct hw_xmit *phwxmit, sint entry)