Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

zhong jiang and committed by
Greg Kroah-Hartman
99aeebe8 2e6ae11d

+1 -2
+1 -2
drivers/misc/sgi-xp/xpc_partition.c
··· 98 98 len = L1_CACHE_ALIGN(len); 99 99 100 100 if (len > buf_len) { 101 - if (buf_base != NULL) 102 - kfree(buf_base); 101 + kfree(buf_base); 103 102 buf_len = L1_CACHE_ALIGN(len); 104 103 buf = xpc_kmalloc_cacheline_aligned(buf_len, GFP_KERNEL, 105 104 &buf_base);