lkml.org 
[lkml]   [2019]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] NFS: remove the redundant check when kfree an object in nfs_netns_client_release
    Date
    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
    \
     
     \ /
      Last update: 2019-09-03 08:08    [W:4.224 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site