Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754592Ab1CMFaU (ORCPT ); Sun, 13 Mar 2011 00:30:20 -0500 Received: from mail-qy0-f181.google.com ([209.85.216.181]:60998 "EHLO mail-qy0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751637Ab1CMF3m (ORCPT ); Sun, 13 Mar 2011 00:29:42 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; b=crh9ZphKTPLKxhj3FsODxIbPHDBG1qul3AwH87hozKpegNtlzfaPeCGu24D11dWllI YrARuDxHztl5a6rodQUIfG4k0qgi/43yI188yumy91Ae9Crq1sF8Sy2fLTJtbpUzU1hd OmbczFoLsSNCucL3EYZKBsGjphaertYbytYZw= From: Ilia Mirkin To: Greg Kroah-Hartman Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH 11/24] staging: rt2860: Remove NULL check before kfree Date: Sun, 13 Mar 2011 00:29:04 -0500 Message-Id: <1299994157-11191-12-git-send-email-imirkin@alum.mit.edu> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1299994157-11191-11-git-send-email-imirkin@alum.mit.edu> References: <20110222145452.GD1331@suse.de> <1299994157-11191-1-git-send-email-imirkin@alum.mit.edu> <1299994157-11191-2-git-send-email-imirkin@alum.mit.edu> <1299994157-11191-3-git-send-email-imirkin@alum.mit.edu> <1299994157-11191-4-git-send-email-imirkin@alum.mit.edu> <1299994157-11191-5-git-send-email-imirkin@alum.mit.edu> <1299994157-11191-6-git-send-email-imirkin@alum.mit.edu> <1299994157-11191-7-git-send-email-imirkin@alum.mit.edu> <1299994157-11191-8-git-send-email-imirkin@alum.mit.edu> <1299994157-11191-9-git-send-email-imirkin@alum.mit.edu> <1299994157-11191-10-git-send-email-imirkin@alum.mit.edu> <1299994157-11191-11-git-send-email-imirkin@alum.mit.edu> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2260 Lines: 74 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 --- drivers/staging/rt2860/common/spectrum.c | 6 ++---- drivers/staging/rt2860/rt_linux.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/staging/rt2860/common/spectrum.c b/drivers/staging/rt2860/common/spectrum.c index 1dfb802..c0d2f42 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 b3f836d..e5b0427 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) -- 1.7.3.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/