Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753364Ab1CMFaH (ORCPT ); Sun, 13 Mar 2011 00:30:07 -0500 Received: from mail-qw0-f46.google.com ([209.85.216.46]:50490 "EHLO mail-qw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750792Ab1CMF30 (ORCPT ); Sun, 13 Mar 2011 00:29:26 -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=l45ZE7bb+vni0Of7OqPE/b7APHWequShJDj3ZDcBCvo8l6YCPnYvBqxAJ8KeCcfgmX 0zq15QRmHLvJPc+vtTX5DidebtlcYI3p4WnCKkTSCFwIW/cG/1ChTT0lmju+P1XzHZn1 bjJza2cYXnMncSzUQEOj04MFM3PU0Ng+mtxB8= From: Ilia Mirkin To: Greg Kroah-Hartman Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/24] staging: ath6kl: Remove NULL check before kfree Date: Sun, 13 Mar 2011 00:28:54 -0500 Message-Id: <1299994157-11191-2-git-send-email-imirkin@alum.mit.edu> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1299994157-11191-1-git-send-email-imirkin@alum.mit.edu> References: <20110222145452.GD1331@suse.de> <1299994157-11191-1-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: 3112 Lines: 92 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 --- .../staging/ath6kl/hif/sdio/linux_sdio/src/hif.c | 4 +--- drivers/staging/ath6kl/os/linux/ar6000_android.c | 4 +--- drivers/staging/ath6kl/os/linux/ar6k_pal.c | 6 ++---- drivers/staging/ath6kl/os/linux/hci_bridge.c | 6 ++---- 4 files changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c b/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c index b9f8c72..8a1cedb 100644 --- a/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c +++ b/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c @@ -1214,9 +1214,7 @@ delHifDevice(HIF_DEVICE * device) { AR_DEBUG_ASSERT(device!= NULL); AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: delHifDevice; 0x%p\n", device)); - if (device->dma_buffer != NULL) { - kfree(device->dma_buffer); - } + kfree(device->dma_buffer); kfree(device); } diff --git a/drivers/staging/ath6kl/os/linux/ar6000_android.c b/drivers/staging/ath6kl/os/linux/ar6000_android.c index f7d1069..002cdc7 100644 --- a/drivers/staging/ath6kl/os/linux/ar6000_android.c +++ b/drivers/staging/ath6kl/os/linux/ar6000_android.c @@ -120,9 +120,7 @@ int logger_write(const enum logidx index, } set_fs(oldfs); out_free_message: - if (msg) { - kfree(msg); - } + kfree(msg); return ret; } #endif diff --git a/drivers/staging/ath6kl/os/linux/ar6k_pal.c b/drivers/staging/ath6kl/os/linux/ar6k_pal.c index fee7cb9..8dd51ee 100644 --- a/drivers/staging/ath6kl/os/linux/ar6k_pal.c +++ b/drivers/staging/ath6kl/os/linux/ar6k_pal.c @@ -260,10 +260,8 @@ static void bt_cleanup_hci_pal(ar6k_hci_pal_info_t *pHciPalInfo) } } - if (pHciPalInfo->hdev != NULL) { - kfree(pHciPalInfo->hdev); - pHciPalInfo->hdev = NULL; - } + kfree(pHciPalInfo->hdev); + pHciPalInfo->hdev = NULL; } /********************************************************* diff --git a/drivers/staging/ath6kl/os/linux/hci_bridge.c b/drivers/staging/ath6kl/os/linux/hci_bridge.c index a02827b..327aab6 100644 --- a/drivers/staging/ath6kl/os/linux/hci_bridge.c +++ b/drivers/staging/ath6kl/os/linux/hci_bridge.c @@ -929,10 +929,8 @@ static void bt_cleanup_hci(struct ar6k_hci_bridge_info *pHcidevInfo) } } - if (pHcidevInfo->pBtStackHCIDev != NULL) { - kfree(pHcidevInfo->pBtStackHCIDev); - pHcidevInfo->pBtStackHCIDev = NULL; - } + kfree(pHcidevInfo->pBtStackHCIDev); + pHcidevInfo->pBtStackHCIDev = NULL; } static int bt_register_hci(struct ar6k_hci_bridge_info *pHcidevInfo) -- 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/