diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-09-26 20:54:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-09-26 20:54:53 -0400 |
commit | 7c1efeae6d7d7b1ba10453e35ee4c2de1d814c2b (patch) | |
tree | 9ec71dfc472aa03a14a29b4189df48a342928d26 | |
parent | 64b796e23172850cab313e2e411b58fd391eec95 (diff) | |
parent | 2110d70c5e58326a10e93cfefdc0b3686e2ada12 (diff) |
Merge tag 'driver-core-4.3-rc3' of git://git.kernel.org/pub/scm/linux/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
-rw-r--r-- | drivers/base/cacheinfo.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c index 764280a91776..e9fd32e91668 100644 --- a/drivers/base/cacheinfo.c +++ b/drivers/base/cacheinfo.c | |||
@@ -148,7 +148,11 @@ static void cache_shared_cpu_map_remove(unsigned int cpu) | |||
148 | 148 | ||
149 | if (sibling == cpu) /* skip itself */ | 149 | if (sibling == cpu) /* skip itself */ |
150 | continue; | 150 | continue; |
151 | |||
151 | sib_cpu_ci = get_cpu_cacheinfo(sibling); | 152 | sib_cpu_ci = get_cpu_cacheinfo(sibling); |
153 | if (!sib_cpu_ci->info_list) | ||
154 | continue; | ||
155 | |||
152 | sib_leaf = sib_cpu_ci->info_list + index; | 156 | sib_leaf = sib_cpu_ci->info_list + index; |
153 | cpumask_clear_cpu(cpu, &sib_leaf->shared_cpu_map); | 157 | cpumask_clear_cpu(cpu, &sib_leaf->shared_cpu_map); |
154 | cpumask_clear_cpu(sibling, &this_leaf->shared_cpu_map); | 158 | cpumask_clear_cpu(sibling, &this_leaf->shared_cpu_map); |
@@ -159,6 +163,9 @@ static void cache_shared_cpu_map_remove(unsigned int cpu) | |||
159 | 163 | ||
160 | static void free_cache_attributes(unsigned int cpu) | 164 | static void free_cache_attributes(unsigned int cpu) |
161 | { | 165 | { |
166 | if (!per_cpu_cacheinfo(cpu)) | ||
167 | return; | ||
168 | |||
162 | cache_shared_cpu_map_remove(cpu); | 169 | cache_shared_cpu_map_remove(cpu); |
163 | 170 | ||
164 | kfree(per_cpu_cacheinfo(cpu)); | 171 | kfree(per_cpu_cacheinfo(cpu)); |
@@ -514,8 +521,7 @@ static int cacheinfo_cpu_callback(struct notifier_block *nfb, | |||
514 | break; | 521 | break; |
515 | case CPU_DEAD: | 522 | case CPU_DEAD: |
516 | cache_remove_dev(cpu); | 523 | cache_remove_dev(cpu); |
517 | if (per_cpu_cacheinfo(cpu)) | 524 | free_cache_attributes(cpu); |
518 | free_cache_attributes(cpu); | ||
519 | break; | 525 | break; |
520 | } | 526 | } |
521 | return notifier_from_errno(rc); | 527 | return notifier_from_errno(rc); |