diff mbox series

nfs: No need to add NULL check before function kfree()

Message ID 1571142316-173812-1-git-send-email-chenxiang66@hisilicon.com (mailing list archive)
State New, archived
Headers show
Series nfs: No need to add NULL check before function kfree() | expand

Commit Message

chenxiang Oct. 15, 2019, 12:25 p.m. UTC
From: Xiang Chen <chenxiang66@hisilicon.com>

It fixes the warning as follows reported by coccicheck:
fs/nfs/sysfs.c:125:2-7: WARNING: NULL check before some freeing functions is not
needed.

Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
---
 fs/nfs/sysfs.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/fs/nfs/sysfs.c b/fs/nfs/sysfs.c
index 4f3390b..c489496 100644
--- a/fs/nfs/sysfs.c
+++ b/fs/nfs/sysfs.c
@@ -121,8 +121,7 @@  static void nfs_netns_client_release(struct kobject *kobj)
 			struct nfs_netns_client,
 			kobject);
 
-	if (c->identifier)
-		kfree(c->identifier);
+	kfree(c->identifier);
 	kfree(c);
 }