Linux-NFS Archive on
 help / color / Atom feed
* [PATCH] NFS: remove redundant null pointer check before kfree
@ 2019-11-16  7:07 Chen Wandun
  0 siblings, 0 replies; only message in thread
From: Chen Wandun @ 2019-11-16  7:07 UTC (permalink / raw)
  To: trond.myklebust, anna.schumaker, linux-nfs, linux-kernel; +Cc: chenwandun

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

Signed-off-by: Chen Wandun <>
 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,
-	if (c->identifier)
-		kfree(c->identifier);
+	kfree(c->identifier);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-16  7:07 [PATCH] NFS: remove redundant null pointer check before kfree Chen Wandun

Linux-NFS Archive on

Archives are clonable:
	git clone --mirror linux-nfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nfs linux-nfs/ \
	public-inbox-index linux-nfs

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone