提交 cbf283c0 编写于 作者: J Jesper Juhl 提交者: Tony Luck

[IA64] Remove redundant NULL checks before kfree

Signed-off-by: NJesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: NTony Luck <tony.luck@intel.com>
上级 c6180deb
......@@ -305,13 +305,10 @@ static struct kobj_type cache_ktype_percpu_entry = {
static void __cpuinit cpu_cache_sysfs_exit(unsigned int cpu)
{
if (all_cpu_cache_info[cpu].cache_leaves) {
kfree(all_cpu_cache_info[cpu].cache_leaves);
all_cpu_cache_info[cpu].cache_leaves = NULL;
}
kfree(all_cpu_cache_info[cpu].cache_leaves);
all_cpu_cache_info[cpu].cache_leaves = NULL;
all_cpu_cache_info[cpu].num_cache_leaves = 0;
memset(&all_cpu_cache_info[cpu].kobj, 0, sizeof(struct kobject));
return;
}
......
......@@ -136,9 +136,7 @@ xpc_get_rsvd_page_pa(int nasid)
}
if (L1_CACHE_ALIGN(len) > buf_len) {
if (buf_base != NULL) {
kfree(buf_base);
}
kfree(buf_base);
buf_len = L1_CACHE_ALIGN(len);
buf = (u64) xpc_kmalloc_cacheline_aligned(buf_len,
GFP_KERNEL, &buf_base);
......@@ -159,9 +157,7 @@ xpc_get_rsvd_page_pa(int nasid)
}
}
if (buf_base != NULL) {
kfree(buf_base);
}
kfree(buf_base);
if (status != SALRET_OK) {
rp_pa = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册