From: chenxiang <chenxiang66@hisilicon.com>
To: <trond.myklebust@hammerspace.com>, <anna.schumaker@netapp.com>
Cc: <linux-nfs@vger.kernel.org>, <linux-fsdevel@vger.kernel.org>,
<linuxarm@huawei.com>, Xiang Chen <chenxiang66@hisilicon.com>
Subject: [PATCH] nfs: No need to add NULL check before function kfree()
Date: Tue, 15 Oct 2019 20:25:16 +0800 [thread overview]
Message-ID: <1571142316-173812-1-git-send-email-chenxiang66@hisilicon.com> (raw)
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 --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);
}
--
2.8.1
reply other threads:[~2019-10-15 12:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1571142316-173812-1-git-send-email-chenxiang66@hisilicon.com \
--to=chenxiang66@hisilicon.com \
--cc=anna.schumaker@netapp.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=trond.myklebust@hammerspace.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.