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: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
14910178fc
commit
aea9d72f97
@@ -416,7 +416,6 @@ void MeasureReqTabExit(struct rt_rtmp_adapter *pAd)
|
|||||||
{
|
{
|
||||||
NdisFreeSpinLock(&pAd->CommonCfg.MeasureReqTabLock);
|
NdisFreeSpinLock(&pAd->CommonCfg.MeasureReqTabLock);
|
||||||
|
|
||||||
if (pAd->CommonCfg.pMeasureReqTab)
|
|
||||||
kfree(pAd->CommonCfg.pMeasureReqTab);
|
kfree(pAd->CommonCfg.pMeasureReqTab);
|
||||||
pAd->CommonCfg.pMeasureReqTab = NULL;
|
pAd->CommonCfg.pMeasureReqTab = NULL;
|
||||||
|
|
||||||
@@ -614,7 +613,6 @@ void TpcReqTabExit(struct rt_rtmp_adapter *pAd)
|
|||||||
{
|
{
|
||||||
NdisFreeSpinLock(&pAd->CommonCfg.TpcReqTabLock);
|
NdisFreeSpinLock(&pAd->CommonCfg.TpcReqTabLock);
|
||||||
|
|
||||||
if (pAd->CommonCfg.pTpcReqTab)
|
|
||||||
kfree(pAd->CommonCfg.pTpcReqTab);
|
kfree(pAd->CommonCfg.pTpcReqTab);
|
||||||
pAd->CommonCfg.pTpcReqTab = NULL;
|
pAd->CommonCfg.pTpcReqTab = NULL;
|
||||||
|
|
||||||
|
@@ -241,7 +241,6 @@ void RTMPFreeAdapter(struct rt_rtmp_adapter *pAd)
|
|||||||
|
|
||||||
os_cookie = (struct os_cookie *)pAd->OS_Cookie;
|
os_cookie = (struct os_cookie *)pAd->OS_Cookie;
|
||||||
|
|
||||||
if (pAd->BeaconBuf)
|
|
||||||
kfree(pAd->BeaconBuf);
|
kfree(pAd->BeaconBuf);
|
||||||
|
|
||||||
NdisFreeSpinLock(&pAd->MgmtRingLock);
|
NdisFreeSpinLock(&pAd->MgmtRingLock);
|
||||||
@@ -264,7 +263,6 @@ void RTMPFreeAdapter(struct rt_rtmp_adapter *pAd)
|
|||||||
release_firmware(pAd->firmware);
|
release_firmware(pAd->firmware);
|
||||||
|
|
||||||
vfree(pAd); /* pci_free_consistent(os_cookie->pci_dev,sizeof(struct rt_rtmp_adapter),pAd,os_cookie->pAd_pa); */
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user