From: Ilia Mirkin <imirkin@alum.mit.edu>
To: Greg Kroah-Hartman <gregkh@suse.de>
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 [thread overview]
Message-ID: <1299994157-11191-2-git-send-email-imirkin@alum.mit.edu> (raw)
In-Reply-To: <1299994157-11191-1-git-send-email-imirkin@alum.mit.edu>
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>
---
.../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
next prev parent reply other threads:[~2011-03-13 5:30 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-22 8:53 [PATCH 1/2] staging: remove null checks " Ilia Mirkin
2011-02-22 8:53 ` [PATCH 2/2] staging: remove null checks before kree(x); x = NULL; Ilia Mirkin
2011-02-22 14:54 ` [PATCH 1/2] staging: remove null checks before kfree Greg KH
2011-03-13 5:28 ` [PATCH 00/24] Remove NULL check " Ilia Mirkin
2011-03-13 5:28 ` Ilia Mirkin [this message]
2011-03-13 5:28 ` [PATCH 02/24] staging: bcm: " Ilia Mirkin
2011-03-13 5:28 ` [PATCH 03/24] staging: brcm80211: " Ilia Mirkin
2011-03-13 5:28 ` [PATCH 04/24] staging: comedi: " Ilia Mirkin
2011-03-13 5:28 ` [PATCH 05/24] staging: cx25821: " Ilia Mirkin
2011-03-13 5:28 ` [PATCH 06/24] staging: go7007: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 07/24] staging: hv: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 08/24] staging: keucr: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 09/24] staging: line6: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 10/24] staging: pohmelfs: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 11/24] staging: rt2860: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 12/24] staging: rtl8187se: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 13/24] staging: rtl8192e: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 14/24] staging: rtl8192u: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 15/24] staging: rtl8712: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 16/24] staging: serqt_usb2: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 17/24] staging: speakup: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 18/24] staging: tidspbridge: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 19/24] staging: usbip: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 20/24] staging: vme: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 21/24] staging: vt6655: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 22/24] staging: vt6656: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 23/24] staging: winbond: " Ilia Mirkin
2011-03-13 5:29 ` [PATCH 24/24] staging: wlan-ng: " Ilia Mirkin
2011-03-14 19:00 ` [PATCH 07/24] staging: hv: " Greg KH
2011-03-14 17:47 ` [PATCH 01/24] staging: ath6kl: " Luis R. Rodriguez
2011-02-24 16:08 ` [PATCH 1/2] staging: remove null checks " Steven Rostedt
2011-02-24 17:06 ` Greg KH
2011-02-24 17:25 ` Steven Rostedt
2011-02-24 19:08 ` Ilia Mirkin
2011-02-24 19:25 ` Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1299994157-11191-2-git-send-email-imirkin@alum.mit.edu \
--to=imirkin@alum.mit.edu \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®