linux-stable/drivers
Stephen Boyd 5a7efdacb9 clkdev: Hold clocks_mutex while iterating clocks list
We recently introduced a change to support devm clk lookups. That change
introduced a code-path that used clk_find() without holding the
'clocks_mutex'. Unfortunately, clk_find() iterates over the 'clocks'
list and so we need to prevent the list from being modified at the same
time. Do this by holding the mutex and checking to make sure it's held
while iterating the list.

Note, we don't really care if the lookup is freed after we find it with
clk_find() because we're just doing a pointer comparison, but if we did
care we would need to keep holding the mutex while we dereference the
clk_lookup pointer.

Fixes: 3eee6c7d11 ("clkdev: add managed clkdev lookup registration")
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Jerome Brunet <jbrunet@baylibre.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Jeffrey Hugo <jhugo@codeaurora.org>
Cc: Chen-Yu Tsai <wens@csie.org>
Cc: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Acked-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Tested-by: Jeffrey Hugo <jhugo@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
2019-04-18 13:33:13 -07:00
..
accessibility
acpi device-dax for 5.1 2019-03-16 13:05:32 -07:00
amba
android
ata
atm
auxdisplay
base device-dax for 5.1 2019-03-16 13:05:32 -07:00
bcma
block for-5.1/block-post-20190315 2019-03-16 12:36:39 -07:00
bluetooth
bus
cdrom
char
clk clkdev: Hold clocks_mutex while iterating clocks list 2019-04-18 13:33:13 -07:00
clocksource ARM: some cleanups, direct physical timer assignment, cache sanitization 2019-03-15 15:00:28 -07:00
connector
cpufreq
cpuidle
crypto
dax device-dax for 5.1 2019-03-16 13:05:32 -07:00
dca
devfreq
dio
dma dmaengine updates for v5.1-rc1 2019-03-14 09:11:54 -07:00
dma-buf
edac
eisa
extcon
firewire
firmware
fmc
fpga
fsi
gnss
gpio
gpu drm i915, amdgpu, qxl and etnaviv fixes 2019-03-15 13:58:35 -07:00
hid
hsi
hv
hwmon
hwspinlock
hwtracing ARM updates for 5.1-rc1 2019-03-15 14:37:46 -07:00
i2c
i3c
ide
idle
iio
infiniband
input
interconnect
iommu IOMMU Fix for Linux v5.1-rc1 2019-03-15 14:41:30 -07:00
ipack
irqchip
isdn
leds
lightnvm
macintosh
mailbox
mcb
md for-5.1/block-post-20190315 2019-03-16 12:36:39 -07:00
media
memory
memstick
message
mfd
misc
mmc
mtd
mux
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-03-14 09:28:12 -07:00
nfc
ntb Fixes for switchtec debugability and mapping table entries, NTB 2019-03-15 14:32:59 -07:00
nubus
nvdimm device-dax for 5.1 2019-03-16 13:05:32 -07:00
nvme for-5.1/block-post-20190315 2019-03-16 12:36:39 -07:00
nvmem
of
opp
oprofile
parisc
parport
pci
pcmcia
perf
phy
pinctrl
platform platform/x86: pmc_atom: Drop __initconst on dmi table 2019-04-11 10:25:37 -07:00
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390 ARM: some cleanups, direct physical timer assignment, cache sanitization 2019-03-15 15:00:28 -07:00
sbus
scsi SCSI misc on 20190315 2019-03-16 12:51:50 -07:00
sfi
sh
siox
slimbus
sn
soc
soundwire
spi
spmi
ssb
staging
target SCSI misc on 20190315 2019-03-16 12:51:50 -07:00
tc
tee
thermal
thunderbolt
tty dmaengine updates for v5.1-rc1 2019-03-14 09:11:54 -07:00
uio
usb
uwb
vfio
vhost
video fbdev changes for v5.1: 2019-03-15 14:22:59 -07:00
virt
virtio
visorbus
vlynq
vme
w1
watchdog
xen xen/balloon: Fix mapping PG_offline pages to user space 2019-03-15 15:35:35 +01:00
zorro
Kconfig
Makefile