diff options
author | zhong jiang <zhongjiang@huawei.com> | 2018-08-16 23:42:35 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-14 09:36:20 -0400 |
commit | 99aeebe8140c642cdf2c3822b1dcbd37433fe770 (patch) | |
tree | b0bcedcce6c388ebb47a03f91552ad9693647b35 /drivers/misc/sgi-xp/xpc_partition.c | |
parent | 2e6ae11dd0d1c37f44cec51a58fb2092e55ed0f5 (diff) |
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/xpc_partition.c')
-rw-r--r-- | drivers/misc/sgi-xp/xpc_partition.c | 3 |
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) | |||
98 | len = L1_CACHE_ALIGN(len); | 98 | len = L1_CACHE_ALIGN(len); |
99 | 99 | ||
100 | if (len > buf_len) { | 100 | if (len > buf_len) { |
101 | if (buf_base != NULL) | 101 | kfree(buf_base); |
102 | kfree(buf_base); | ||
103 | buf_len = L1_CACHE_ALIGN(len); | 102 | buf_len = L1_CACHE_ALIGN(len); |
104 | buf = xpc_kmalloc_cacheline_aligned(buf_len, GFP_KERNEL, | 103 | buf = xpc_kmalloc_cacheline_aligned(buf_len, GFP_KERNEL, |
105 | &buf_base); | 104 | &buf_base); |