s390/cacheinfo: don't use smp_processor_id() in preemptible context
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Mon, 9 Feb 2015 11:54:16 +0000 (12:54 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 10 Feb 2015 09:15:57 +0000 (10:15 +0100)
commit45cce4ccafe3cddc924ef5221d22b9853fc9a13c
tree3afaaeec8ecc47be92aa209b715c84522ff9c1f5
parentea96f78813823ab186e7e52122c06fb9c3cf6e20
s390/cacheinfo: don't use smp_processor_id() in preemptible context

show_cacheinfo() needs to access the cacheinfo structure of any online
cpu. This was done with using smp_processor_id() as in index while in
preemtible context.
This means the cpu could be offline and the data be gone when it would
be accessed.
Better use any online cpu address and protect the data by get_online_cpus()
and put_online_cpus().

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/kernel/cache.c