提交 aea9d72f 编写于 作者: I Ilia Mirkin 提交者: Greg Kroah-Hartman

staging: rt2860: Remove NULL check before kfree

This patch was generated by the following semantic patch:
// <smpl>
@@ expression E; @@
- if (E != NULL) { kfree(E); }
+ kfree(E);

@@ expression E; @@
- if (E != NULL) { kfree(E); E = NULL; }
+ kfree(E);
+ E = NULL;
// </smpl>
Signed-off-by: NIlia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 14910178
......@@ -416,8 +416,7 @@ void MeasureReqTabExit(struct rt_rtmp_adapter *pAd)
{
NdisFreeSpinLock(&pAd->CommonCfg.MeasureReqTabLock);
if (pAd->CommonCfg.pMeasureReqTab)
kfree(pAd->CommonCfg.pMeasureReqTab);
kfree(pAd->CommonCfg.pMeasureReqTab);
pAd->CommonCfg.pMeasureReqTab = NULL;
return;
......@@ -614,8 +613,7 @@ void TpcReqTabExit(struct rt_rtmp_adapter *pAd)
{
NdisFreeSpinLock(&pAd->CommonCfg.TpcReqTabLock);
if (pAd->CommonCfg.pTpcReqTab)
kfree(pAd->CommonCfg.pTpcReqTab);
kfree(pAd->CommonCfg.pTpcReqTab);
pAd->CommonCfg.pTpcReqTab = NULL;
return;
......
......@@ -241,8 +241,7 @@ void RTMPFreeAdapter(struct rt_rtmp_adapter *pAd)
os_cookie = (struct os_cookie *)pAd->OS_Cookie;
if (pAd->BeaconBuf)
kfree(pAd->BeaconBuf);
kfree(pAd->BeaconBuf);
NdisFreeSpinLock(&pAd->MgmtRingLock);
......@@ -264,8 +263,7 @@ void RTMPFreeAdapter(struct rt_rtmp_adapter *pAd)
release_firmware(pAd->firmware);
vfree(pAd); /* pci_free_consistent(os_cookie->pci_dev,sizeof(struct rt_rtmp_adapter),pAd,os_cookie->pAd_pa); */
if (os_cookie)
kfree(os_cookie);
kfree(os_cookie);
}
BOOLEAN OS_Need_Clone_Packet(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册