summaryrefslogtreecommitdiffstats
path: root/drivers/misc/sgi-xp
diff options
context:
space:
mode:
authorzhong jiang <zhongjiang@huawei.com>2018-08-17 11:42:35 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-09-14 15:36:20 +0200
commit99aeebe8140c642cdf2c3822b1dcbd37433fe770 (patch)
treeb0bcedcce6c388ebb47a03f91552ad9693647b35 /drivers/misc/sgi-xp
parent2e6ae11dd0d1c37f44cec51a58fb2092e55ed0f5 (diff)
downloadlinux-99aeebe8140c642cdf2c3822b1dcbd37433fe770.tar.bz2
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 <zhongjiang@huawei.com> Acked-by: Robin Holt <robinmholt@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/sgi-xp')
-rw-r--r--drivers/misc/sgi-xp/xpc_partition.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/misc/sgi-xp/xpc_partition.c b/drivers/misc/sgi-xp/xpc_partition.c
index 0c3ef6f1df54..3eba1c420cc0 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);