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

[IA64] Remove redundant NULL checks before kfree

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>

authored by

Jesper Juhl and committed by
Tony Luck
cbf283c0 c6180deb

+4 -11
+2 -5
arch/ia64/kernel/topology.c
··· 305 305 306 306 static void __cpuinit cpu_cache_sysfs_exit(unsigned int cpu) 307 307 { 308 - if (all_cpu_cache_info[cpu].cache_leaves) { 309 - kfree(all_cpu_cache_info[cpu].cache_leaves); 310 - all_cpu_cache_info[cpu].cache_leaves = NULL; 311 - } 308 + kfree(all_cpu_cache_info[cpu].cache_leaves); 309 + all_cpu_cache_info[cpu].cache_leaves = NULL; 312 310 all_cpu_cache_info[cpu].num_cache_leaves = 0; 313 311 memset(&all_cpu_cache_info[cpu].kobj, 0, sizeof(struct kobject)); 314 - 315 312 return; 316 313 } 317 314
+2 -6
arch/ia64/sn/kernel/xpc_partition.c
··· 136 136 } 137 137 138 138 if (L1_CACHE_ALIGN(len) > buf_len) { 139 - if (buf_base != NULL) { 140 - kfree(buf_base); 141 - } 139 + kfree(buf_base); 142 140 buf_len = L1_CACHE_ALIGN(len); 143 141 buf = (u64) xpc_kmalloc_cacheline_aligned(buf_len, 144 142 GFP_KERNEL, &buf_base); ··· 157 159 } 158 160 } 159 161 160 - if (buf_base != NULL) { 161 - kfree(buf_base); 162 - } 162 + kfree(buf_base); 163 163 164 164 if (status != SALRET_OK) { 165 165 rp_pa = 0;