1
0
Fork 0
alistair23-linux/drivers/pwm
Hauke Mehrtens 72407e5aa0 pwm: img: Fix null pointer access in probe
[ Upstream commit b39c0615d0 ]

dev_get_drvdata() is called in img_pwm_runtime_resume() before the
driver data is set.
When pm_runtime_enabled() returns false in img_pwm_probe() it calls
img_pwm_runtime_resume() which results in a null pointer access.

This patch fixes the problem by setting the driver data earlier in the
img_pwm_probe() function.

This crash was seen when booting the Imagination Technologies Creator
Ci40 (Marduk) with kernel 5.4 in OpenWrt.

Fixes: e690ae5262 ("pwm: img: Add runtime PM")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-10-29 09:57:54 +01:00
..
Kconfig
Makefile
core.c
pwm-ab8500.c
pwm-atmel-hlcdc.c
pwm-atmel-tcb.c
pwm-atmel.c
pwm-bcm-iproc.c pwm: bcm-iproc: handle clk_get_rate() return 2020-08-21 13:05:34 +02:00
pwm-bcm-kona.c
pwm-bcm2835.c pwm: bcm2835: Dynamically allocate base 2020-04-29 16:33:02 +02:00
pwm-berlin.c
pwm-brcmstb.c
pwm-clps711x.c
pwm-crc.c
pwm-cros-ec.c
pwm-ep93xx.c
pwm-fsl-ftm.c
pwm-hibvt.c
pwm-img.c pwm: img: Fix null pointer access in probe 2020-10-29 09:57:54 +01:00
pwm-imx-tpm.c
pwm-imx1.c
pwm-imx27.c
pwm-jz4740.c pwm: jz4740: Fix build failure 2020-07-16 08:16:48 +02:00
pwm-lp3943.c
pwm-lpc18xx-sct.c
pwm-lpc32xx.c
pwm-lpss-pci.c
pwm-lpss-platform.c
pwm-lpss.c pwm: lpss: Add range limit check for the base_unit register value 2020-10-29 09:57:38 +01:00
pwm-lpss.h
pwm-mediatek.c
pwm-meson.c
pwm-mtk-disp.c
pwm-mxs.c
pwm-omap-dmtimer.c pwm: omap-dmtimer: put_device() after of_find_device_by_node() 2020-03-05 16:43:49 +01:00
pwm-pca9685.c pwm: pca9685: Fix PWM/GPIO inter-operation 2020-04-21 09:04:52 +02:00
pwm-puv3.c
pwm-pxa.c
pwm-rcar.c pwm: rcar: Fix late Runtime PM enablement 2020-04-29 16:32:58 +02:00
pwm-renesas-tpu.c pwm: renesas-tpu: Fix late Runtime PM enablement 2020-04-29 16:33:02 +02:00
pwm-rockchip.c
pwm-samsung.c
pwm-sifive.c
pwm-spear.c
pwm-sprd.c
pwm-sti.c
pwm-stm32-lp.c
pwm-stm32.c
pwm-stmpe.c
pwm-sun4i.c pwm: sun4i: Fix incorrect calculation of duty_cycle/period 2020-01-26 10:01:04 +01:00
pwm-tegra.c
pwm-tiecap.c
pwm-tiehrpwm.c
pwm-tipwmss.c
pwm-twl-led.c
pwm-twl.c
pwm-vt8500.c
pwm-zx.c
sysfs.c