From: zhong jiang Date: Wed, 4 Sep 2019 10:03:28 +0000 (+0800) Subject: staging: exfat: remove the redundant check when kfree an object in exfat_destroy_inode X-Git-Tag: v5.4-rc1~134^2~53 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=59d45f2a4d4a9fbea07f285994cae31ac13f2493;hp=7f95bb6aa3dd4f732edb05fe64b255b27bcc97d2;p=linux.git staging: exfat: remove the redundant check when kfree an object in exfat_destroy_inode kfree has taken the null check in account. hence it is unnecessary to add the null check before kfree the object. Just remove it. Reported-by: Julia Lawall Signed-off-by: zhong jiang Link: https://lore.kernel.org/r/1567591408-24268-1-git-send-email-zhongjiang@huawei.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/exfat/exfat_super.c b/drivers/staging/exfat/exfat_super.c index 95bb606766b6..46ff33688c42 100644 --- a/drivers/staging/exfat/exfat_super.c +++ b/drivers/staging/exfat/exfat_super.c @@ -3498,8 +3498,7 @@ static struct inode *exfat_alloc_inode(struct super_block *sb) static void exfat_destroy_inode(struct inode *inode) { - if (EXFAT_I(inode)->target) - kfree(EXFAT_I(inode)->target); + kfree(EXFAT_I(inode)->target); EXFAT_I(inode)->target = NULL; kmem_cache_free(exfat_inode_cachep, EXFAT_I(inode));