diff mbox

[1/1] fs/jffs2/xattr.c: remove null test before kfree

Message ID 1402941769-4539-1-git-send-email-fabf@skynet.be
State Accepted
Commit 086f2f76f498837283433b2b3b76125dc15328fc
Headers show

Commit Message

Fabian Frederick June 16, 2014, 6:02 p.m. UTC
Fix checkpatch warning:
WARNING: kfree(NULL) is safe this check is probably not required

Cc: David Woodhouse <dwmw2@infradead.org>
Cc: linux-mtd@lists.infradead.org
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 fs/jffs2/xattr.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Brian Norris July 3, 2014, 12:38 a.m. UTC | #1
On Mon, Jun 16, 2014 at 08:02:49PM +0200, Fabian Frederick wrote:
> Fix checkpatch warning:
> WARNING: kfree(NULL) is safe this check is probably not required
> 
> Cc: David Woodhouse <dwmw2@infradead.org>
> Cc: linux-mtd@lists.infradead.org
> Signed-off-by: Fabian Frederick <fabf@skynet.be>

Pushed to l2-mtd.git. Thanks!

Brian
diff mbox

Patch

diff --git a/fs/jffs2/xattr.c b/fs/jffs2/xattr.c
index ad0f2e2..d72817a 100644
--- a/fs/jffs2/xattr.c
+++ b/fs/jffs2/xattr.c
@@ -756,8 +756,7 @@  void jffs2_clear_xattr_subsystem(struct jffs2_sb_info *c)
 	for (i=0; i < XATTRINDEX_HASHSIZE; i++) {
 		list_for_each_entry_safe(xd, _xd, &c->xattrindex[i], xindex) {
 			list_del(&xd->xindex);
-			if (xd->xname)
-				kfree(xd->xname);
+			kfree(xd->xname);
 			jffs2_free_xattr_datum(xd);
 		}
 	}