Linux-NFS Archive on lore.kernel.org
 help / color / 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	[flat|nested] 4+ messages in thread

* Re: NFS: remove the redundant check when kfree an object in nfs_netns_client_release
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Markus Elfring @ 2019-09-04 15:11 UTC (permalink / raw)
  To: zhong jiang, Anna Schumaker, Trond Myklebust, linux-nfs
  Cc: linux-kernel, kernel-janitors

> kfree has taken the null check in account.

I suggest to take another look at a similar patch.

NFS: fix ifnullfree.cocci warnings
https://lkml.org/lkml/2019/7/7/73
https://lore.kernel.org/patchwork/patch/1098005/
https://lore.kernel.org/r/alpine.DEB.2.21.1907071844310.2521@hadrien/

Regards,
Markus

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

* Re: NFS: remove the redundant check when kfree an object in nfs_netns_client_release
  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
  0 siblings, 1 reply; 4+ messages in thread
From: zhong jiang @ 2019-09-05  2:40 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Anna Schumaker, Trond Myklebust, linux-nfs, linux-kernel,
	kernel-janitors

On 2019/9/4 23:11, Markus Elfring wrote:
>> kfree has taken the null check in account.
> I suggest to take another look at a similar patch.
How to fast find out the similar patch. Search the key word doesn't work well.

Thanks,
zhong jiang
> NFS: fix ifnullfree.cocci warnings
> https://lkml.org/lkml/2019/7/7/73
> https://lore.kernel.org/patchwork/patch/1098005/
> https://lore.kernel.org/r/alpine.DEB.2.21.1907071844310.2521@hadrien/
>
> Regards,
> Markus
>
> .
>



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

* Re: NFS: Checking the handling of patch variations
  2019-09-05  2:40   ` zhong jiang
@ 2019-09-05  9:00     ` Markus Elfring
  0 siblings, 0 replies; 4+ messages in thread
From: Markus Elfring @ 2019-09-05  9:00 UTC (permalink / raw)
  To: zhong jiang, kernel-janitors
  Cc: Anna Schumaker, Trond Myklebust, linux-nfs, linux-kernel

>> I suggest to take another look at a similar patch.
> How to fast find out the similar patch. Search the key word doesn't work well.

This is a recurring development challenge, isn't it?

The occurrence of related update suggestions can occasionally become
more interesting.

Regards,
Markus

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

end of thread, back to index

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

Linux-NFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-nfs/0 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/ https://lore.kernel.org/linux-nfs \
		linux-nfs@vger.kernel.org linux-nfs@archiver.kernel.org
	public-inbox-index linux-nfs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-nfs


AGPL code for this site: git clone https://public-inbox.org/ public-inbox