mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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 08/24] staging: keucr: Remove NULL check before kfree
Date: Sun, 13 Mar 2011 00:29:01 -0500	[thread overview]
Message-ID: <1299994157-11191-9-git-send-email-imirkin@alum.mit.edu> (raw)
In-Reply-To: <1299994157-11191-8-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>
---
 drivers/staging/keucr/ms.c |   22 ++++++++--------------
 1 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/keucr/ms.c b/drivers/staging/keucr/ms.c
index 48496e4..a713721 100644
--- a/drivers/staging/keucr/ms.c
+++ b/drivers/staging/keucr/ms.c
@@ -244,8 +244,8 @@ int MS_CardInit(struct us_data *us)
 	result = MS_STATUS_SUCCESS;
 
 exit:
-	if (PageBuffer1)		kfree(PageBuffer1);
-    	if (PageBuffer0)		kfree(PageBuffer0);
+	kfree(PageBuffer1);
+    	kfree(PageBuffer0);
 
 	printk("MS_CardInit end\n");
 	return result;
@@ -280,7 +280,7 @@ int MS_LibCheckDisableBlock(struct us_data *us, WORD PhyBlock)
 	} while(1);
 
 exit:
-	if (PageBuf)	kfree(PageBuf);
+	kfree(PageBuf);
 	return result;
 }
 
@@ -324,17 +324,11 @@ void MS_LibFreeWriteBuf(struct us_data *us)
 //----- MS_LibFreeLogicalMap() ---------------------------------------
 int MS_LibFreeLogicalMap(struct us_data *us)
 {
-	if (us->MS_Lib.Phy2LogMap)
-	{
-		kfree(us->MS_Lib.Phy2LogMap);
-		us->MS_Lib.Phy2LogMap = NULL;
-	}
+	kfree(us->MS_Lib.Phy2LogMap);
+	us->MS_Lib.Phy2LogMap = NULL;
 
-	if (us->MS_Lib.Log2PhyMap)
-	{
-		kfree(us->MS_Lib.Log2PhyMap);
-		us->MS_Lib.Log2PhyMap = NULL;
-	}
+	kfree(us->MS_Lib.Log2PhyMap);
+	us->MS_Lib.Log2PhyMap = NULL;
 
     return 0;
 }
@@ -470,7 +464,7 @@ int MS_LibProcessBootBlock(struct us_data *us, WORD PhyBlock, BYTE *PageData)
 
 exit:
 	if (result)		MS_LibFreeLogicalMap(us);
-	if (PageBuffer)	kfree(PageBuffer);
+	kfree(PageBuffer);
 
 	result = 0;
 	return result;
-- 
1.7.3.4


  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     ` [PATCH 01/24] staging: ath6kl: " Ilia Mirkin
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                   ` Ilia Mirkin [this message]
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-9-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®