Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932087Ab1CMFaw (ORCPT ); Sun, 13 Mar 2011 00:30:52 -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 S1752866Ab1CMF36 (ORCPT ); Sun, 13 Mar 2011 00:29:58 -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=KpfeXmLmwkcuy74SK94H0meRv6YIc+1kb4wnqVEguoehjYuLLX+UpBvvlAIcb1ln0j 059ZlDDu+Dx3u9poBLKAysYzRWNHygoLjQ11IzKKuyaECwoD+2ouos8HGKm2ZHkYH4Gr VE2kiixp5HbC0vWOU6zOXYOi64HiA2zD7QpVs= From: Ilia Mirkin To: Greg Kroah-Hartman Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH 22/24] staging: vt6656: Remove NULL check before kfree Date: Sun, 13 Mar 2011 00:29:15 -0500 Message-Id: <1299994157-11191-23-git-send-email-imirkin@alum.mit.edu> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1299994157-11191-22-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> <1299994157-11191-12-git-send-email-imirkin@alum.mit.edu> <1299994157-11191-13-git-send-email-imirkin@alum.mit.edu> <1299994157-11191-14-git-send-email-imirkin@alum.mit.edu> <1299994157-11191-15-git-send-email-imirkin@alum.mit.edu> <1299994157-11191-16-git-send-email-imirkin@alum.mit.edu> <1299994157-11191-17-git-send-email-imirkin@alum.mit.edu> <1299994157-11191-18-git-send-email-imirkin@alum.mit.edu> <1299994157-11191-19-git-send-email-imirkin@alum.mit.edu> <1299994157-11191-20-git-send-email-imirkin@alum.mit.edu> <1299994157-11191-21-git-send-email-imirkin@alum.mit.edu> <1299994157-11191-22-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: 2978 Lines: 114 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/vt6656/firmware.c | 3 +-- drivers/staging/vt6656/hostap.c | 3 +-- drivers/staging/vt6656/main_usb.c | 12 ++++-------- drivers/staging/vt6656/wpactl.c | 3 +-- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/drivers/staging/vt6656/firmware.c b/drivers/staging/vt6656/firmware.c index 1625412..8c8126a 100644 --- a/drivers/staging/vt6656/firmware.c +++ b/drivers/staging/vt6656/firmware.c @@ -109,8 +109,7 @@ FIRMWAREbDownload( result = TRUE; out: - if (pBuffer) - kfree(pBuffer); + kfree(pBuffer); spin_lock_irq(&pDevice->lock); return result; diff --git a/drivers/staging/vt6656/hostap.c b/drivers/staging/vt6656/hostap.c index f70e922..51b5adf 100644 --- a/drivers/staging/vt6656/hostap.c +++ b/drivers/staging/vt6656/hostap.c @@ -858,8 +858,7 @@ int vt6656_hostap_ioctl(PSDevice pDevice, struct iw_point *p) } out: - if (param != NULL) - kfree(param); + kfree(param); return ret; } diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c index 37d6396..af14ab0 100644 --- a/drivers/staging/vt6656/main_usb.c +++ b/drivers/staging/vt6656/main_usb.c @@ -837,8 +837,7 @@ static void device_free_tx_bufs(PSDevice pDevice) usb_kill_urb(pTxContext->pUrb); usb_free_urb(pTxContext->pUrb); } - if (pTxContext) - kfree(pTxContext); + kfree(pTxContext); } return; } @@ -861,8 +860,7 @@ static void device_free_rx_bufs(PSDevice pDevice) if (pRCB->skb) dev_kfree_skb(pRCB->skb); } - if (pDevice->pRCBMem) - kfree(pDevice->pRCBMem); + kfree(pDevice->pRCBMem); return; } @@ -878,8 +876,7 @@ static void usb_device_reset(PSDevice pDevice) static void device_free_int_bufs(PSDevice pDevice) { - if (pDevice->intBuf.pDataBuf != NULL) - kfree(pDevice->intBuf.pDataBuf); + kfree(pDevice->intBuf.pDataBuf); return; } @@ -1480,8 +1477,7 @@ error2: */ if(result!=0) { - if(buffer) - kfree(buffer); + kfree(buffer); buffer=NULL; } return buffer; diff --git a/drivers/staging/vt6656/wpactl.c b/drivers/staging/vt6656/wpactl.c index 7fd300f..8752736 100644 --- a/drivers/staging/vt6656/wpactl.c +++ b/drivers/staging/vt6656/wpactl.c @@ -999,8 +999,7 @@ int wpa_ioctl(PSDevice pDevice, struct iw_point *p) } out: - if (param != NULL) - kfree(param); + kfree(param); return ret; } -- 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/