public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Syam Sidhardhan <syamsidhardh@gmail.com>
To: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: dwmw2@infradead.org, syamsidhardh@gmail.com
Subject: [PATCH] mtd: maps: Remove redundant NULL check before kfree
Date: Wed, 27 Feb 2013 01:16:56 +0530	[thread overview]
Message-ID: <1361908016-3110-1-git-send-email-s.syam@samsung.com> (raw)

kfree on NULL pointer is a no-op.

Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
---
 drivers/mtd/maps/ck804xrom.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mtd/maps/ck804xrom.c b/drivers/mtd/maps/ck804xrom.c
index 586a1c7..0455166 100644
--- a/drivers/mtd/maps/ck804xrom.c
+++ b/drivers/mtd/maps/ck804xrom.c
@@ -308,8 +308,7 @@ static int ck804xrom_init_one(struct pci_dev *pdev,
 
  out:
 	/* Free any left over map structures */
-	if (map)
-		kfree(map);
+	kfree(map);
 
 	/* See if I have any map structures */
 	if (list_empty(&window->maps)) {
-- 
1.7.9.5

             reply	other threads:[~2013-02-26 19:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-26 19:46 Syam Sidhardhan [this message]
2013-03-08 13:18 ` [PATCH] mtd: maps: Remove redundant NULL check before kfree Artem Bityutskiy

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=1361908016-3110-1-git-send-email-s.syam@samsung.com \
    --to=syamsidhardh@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.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