From: Ilia Mirkin Date: Sun, 13 Mar 2011 05:29:04 +0000 (-0500) Subject: staging: rt2860: Remove NULL check before kfree X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=aea9d72f97218d45e993836bcb6c6e6fd49e0b90;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git staging: rt2860: Remove NULL check before kfree This patch was generated by the following semantic patch: // @@ expression E; @@ - if (E != NULL) { kfree(E); } + kfree(E); @@ expression E; @@ - if (E != NULL) { kfree(E); E = NULL; } + kfree(E); + E = NULL; // Signed-off-by: Ilia Mirkin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rt2860/common/spectrum.c b/drivers/staging/rt2860/common/spectrum.c index 1dfb802aab9a..c0d2f428069c 100644 --- a/drivers/staging/rt2860/common/spectrum.c +++ b/drivers/staging/rt2860/common/spectrum.c @@ -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; diff --git a/drivers/staging/rt2860/rt_linux.c b/drivers/staging/rt2860/rt_linux.c index b3f836de332b..e5b042712430 100644 --- a/drivers/staging/rt2860/rt_linux.c +++ b/drivers/staging/rt2860/rt_linux.c @@ -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)