Skip to contentSkip to conversation

NFS: remove redundant null pointer check before kfree

PATCH New Chen Wandun 1 participant 1 message Nov 16, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NFS: remove redundant null pointer check before kfree

kfree has taken null pointer check into account. so it is safe to remove the unnecessary check.

---
 fs/nfs/sysfs.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/nfs/sysfs.c +1 -2
index 4f3390b..c489496 100644
@@ -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);
 }
 
Signature · 1 line
2.7.4