소스 검색

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>
zhong jiang 7 년 전
부모
커밋
99aeebe814
1개의 변경된 파일1개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 2
      drivers/misc/sgi-xp/xpc_partition.c

+ 1 - 2
drivers/misc/sgi-xp/xpc_partition.c

@@ -98,8 +98,7 @@ xpc_get_rsvd_page_pa(int nasid)
 			len = L1_CACHE_ALIGN(len);
 			len = L1_CACHE_ALIGN(len);
 
 
 		if (len > buf_len) {
 		if (len > buf_len) {
-			if (buf_base != NULL)
-				kfree(buf_base);
+			kfree(buf_base);
 			buf_len = L1_CACHE_ALIGN(len);
 			buf_len = L1_CACHE_ALIGN(len);
 			buf = xpc_kmalloc_cacheline_aligned(buf_len, GFP_KERNEL,
 			buf = xpc_kmalloc_cacheline_aligned(buf_len, GFP_KERNEL,
 							    &buf_base);
 							    &buf_base);