Skip to content

Commit

Permalink
[IA64] Remove redundant NULL checks before kfree
Browse files Browse the repository at this point in the history
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
  • Loading branch information
Jesper Juhl authored and Tony Luck committed Apr 20, 2006
1 parent c6180de commit cbf283c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
7 changes: 2 additions & 5 deletions arch/ia64/kernel/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
8 changes: 2 additions & 6 deletions arch/ia64/sn/kernel/xpc_partition.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down

0 comments on commit cbf283c

Please sign in to comment.