From: zhong jiang Date: Fri, 17 Aug 2018 03:42:35 +0000 (+0800) Subject: misc: sgi-xp: remove meaningless null check before kfree X-Git-Tag: v5.15~7734^2~190 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=99aeebe8140c642cdf2c3822b1dcbd37433fe770;p=platform%2Fkernel%2Flinux-starfive.git misc: sgi-xp: remove meaningless null check before kfree kfree has taken null pointer into account. so check the null pointer before kfree is meaningless. Signed-off-by: zhong jiang Acked-by: Robin Holt Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/misc/sgi-xp/xpc_partition.c b/drivers/misc/sgi-xp/xpc_partition.c index 0c3ef6f..3eba1c4 100644 --- a/drivers/misc/sgi-xp/xpc_partition.c +++ b/drivers/misc/sgi-xp/xpc_partition.c @@ -98,8 +98,7 @@ xpc_get_rsvd_page_pa(int nasid) len = L1_CACHE_ALIGN(len); if (len > buf_len) { - if (buf_base != NULL) - kfree(buf_base); + kfree(buf_base); buf_len = L1_CACHE_ALIGN(len); buf = xpc_kmalloc_cacheline_aligned(buf_len, GFP_KERNEL, &buf_base);