Skip to content

Commit

Permalink
Merge tag 'driver-core-4.3-rc3' of git://git.kernel.org/pub/scm/linux…
Browse files Browse the repository at this point in the history
…/kernel/git/gregkh/driver-core

Pull driver core fix from Greg KH:
 "Here is one driver core fix for 4.3-rc3 that resolves a reported oops"

* tag 'driver-core-4.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
  cpu/cacheinfo: Fix teardown path
  • Loading branch information
torvalds committed Sep 27, 2015
2 parents 64b796e + 2110d70 commit 7c1efea
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/base/cacheinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ static void cache_shared_cpu_map_remove(unsigned int cpu)

if (sibling == cpu) /* skip itself */
continue;

sib_cpu_ci = get_cpu_cacheinfo(sibling);
if (!sib_cpu_ci->info_list)
continue;

sib_leaf = sib_cpu_ci->info_list + index;
cpumask_clear_cpu(cpu, &sib_leaf->shared_cpu_map);
cpumask_clear_cpu(sibling, &this_leaf->shared_cpu_map);
Expand All @@ -159,6 +163,9 @@ static void cache_shared_cpu_map_remove(unsigned int cpu)

static void free_cache_attributes(unsigned int cpu)
{
if (!per_cpu_cacheinfo(cpu))
return;

cache_shared_cpu_map_remove(cpu);

kfree(per_cpu_cacheinfo(cpu));
Expand Down Expand Up @@ -514,8 +521,7 @@ static int cacheinfo_cpu_callback(struct notifier_block *nfb,
break;
case CPU_DEAD:
cache_remove_dev(cpu);
if (per_cpu_cacheinfo(cpu))
free_cache_attributes(cpu);
free_cache_attributes(cpu);
break;
}
return notifier_from_errno(rc);
Expand Down

0 comments on commit 7c1efea

Please sign in to comment.