kfree(..) on a NULL pointer is a no-op; the null test here is redundant.
Detected by coccicheck.
Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
rtw_hal_set_hwreg(padapter, HW_VAR_EFUSE_USAGE, (u8 *)&efuse_usage);
}
- if (efuseTbl)
- kfree(efuseTbl);
+ kfree(efuseTbl);
}
static void hal_ReadEFuse_BT(
}
exit:
- if (efuseTbl)
- kfree(efuseTbl);
+ kfree(efuseTbl);
}
static void Hal_ReadEFuse(
if (!err)
memcpy(pbuf, ptmpbuf, cnt);
- if (ptmpbuf)
- kfree(ptmpbuf);
+ kfree(ptmpbuf);
return err;
}
if (!err)
memcpy(pbuf, ptmpbuf, cnt);
- if (ptmpbuf)
- kfree(ptmpbuf);
+ kfree(ptmpbuf);
return err;
}
}
addkey_end:
- if (param)
- {
- kfree((u8 *)param);
- }
+ kfree((u8 *)param);
return ret;
pairwise_cipher, padapter->securitypriv.ndisencryptstatus, padapter->securitypriv.ndisauthtype));
exit:
- if (buf)
- kfree(buf);
+ kfree(buf);
if (ret)
_clr_fwstate_(&padapter->mlmepriv, WIFI_UNDER_WPS);
return ret;
exit:
- if (pwep) {
- kfree((u8 *)pwep);
- }
+ kfree((u8 *)pwep);
return ret;
}
exit:
- if (buf) kfree(buf);
+ kfree(buf);
return ret;
}
ret = wpa_set_encryption(dev, param, param_len);
exit:
- if (param)
- {
- kfree((u8 *)param);
- }
+ kfree((u8 *)param);
return ret;
}
}
exit:
-
- if (pwep)
- {
- kfree((u8 *)pwep);
- }
+ kfree((u8 *)pwep);
return ret;
}
exit:
- if (input)
- kfree(input);
- if (buffer)
- kfree(buffer);
- if (output)
- kfree(output);
+ kfree(input);
+ kfree(buffer);
+ kfree(output);
return err;
}
void rtw_os_xmit_resource_free(struct adapter *padapter, struct xmit_buf *pxmitbuf, u32 free_sz, u8 flag)
{
- if (free_sz > 0) {
- if (pxmitbuf->pallocated_buf)
- kfree(pxmitbuf->pallocated_buf);
- }
+ if (free_sz > 0)
+ kfree(pxmitbuf->pallocated_buf);
}
#define WMM_XMIT_THRESHOLD (NR_XMITFRAME*2/5)