linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] NFS: remove the redundant check when kfree an object in nfs_netns_client_release
@ 2019-09-03  6:04 zhong jiang
  2019-09-04 15:11 ` Markus Elfring
  0 siblings, 1 reply; 4+ messages in thread
From: zhong jiang @ 2019-09-03  6:04 UTC (permalink / raw)
  To: trond.myklebust, anna.schumaker; +Cc: zhongjiang, linux-nfs, linux-kernel

kfree has taken the null check in account. hence it is unnecessary to add the
null check before kfree the object. Just remove it.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 fs/nfs/sysfs.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

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);
 }
 
-- 
1.7.12.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-09-05  9:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-03  6:04 [PATCH] NFS: remove the redundant check when kfree an object in nfs_netns_client_release zhong jiang
2019-09-04 15:11 ` Markus Elfring
2019-09-05  2:40   ` zhong jiang
2019-09-05  9:00     ` NFS: Checking the handling of patch variations Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).