linux-stable/drivers/pwm
Uwe Kleine-König 6f4f778f27 pwm: lpc18xx-sct: Initialize driver data and hardware before pwmchip_add()
[ Upstream commit 0401f24cd2 ]

When a driver calls pwmchip_add() it has to be prepared to immediately
get its callbacks called. So move allocation of driver data and hardware
initialization before the call to pwmchip_add().

This fixes a potential NULL pointer exception and a race condition on
register writes.

Fixes: 841e6f90bb ("pwm: NXP LPC18xx PWM/SCT driver")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-04-08 14:23:44 +02:00
..
core.c pwm: Make pwmchip_remove() return void 2021-09-02 21:38:56 +02:00
Kconfig
Makefile
pwm-ab8500.c
pwm-atmel-hlcdc.c pwm: atmel-hlcdc: Don't check the return code of pwmchip_remove() 2021-09-02 21:38:49 +02:00
pwm-atmel-tcb.c pwm: atmel-tcb: Don't check the return code of pwmchip_remove() 2021-09-02 21:38:50 +02:00
pwm-atmel.c
pwm-bcm-iproc.c
pwm-bcm-kona.c
pwm-bcm2835.c
pwm-berlin.c
pwm-brcmstb.c pwm: brcmstb: Don't check the return code of pwmchip_remove() 2021-09-02 21:38:50 +02:00
pwm-clps711x.c
pwm-crc.c
pwm-cros-ec.c pwm: cros-ec: Don't check the return code of pwmchip_remove() 2021-09-02 21:38:51 +02:00
pwm-dwc.c
pwm-ep93xx.c
pwm-fsl-ftm.c
pwm-hibvt.c
pwm-img.c pwm: img: Don't check the return code of pwmchip_remove() 2021-09-02 21:38:51 +02:00
pwm-imx-tpm.c pwm: imx-tpm: Don't check the return code of pwmchip_remove() 2021-09-02 21:38:52 +02:00
pwm-imx1.c
pwm-imx27.c
pwm-intel-lgm.c
pwm-iqs620a.c
pwm-jz4740.c
pwm-keembay.c
pwm-lp3943.c
pwm-lpc18xx-sct.c pwm: lpc18xx-sct: Initialize driver data and hardware before pwmchip_add() 2022-04-08 14:23:44 +02:00
pwm-lpc32xx.c
pwm-lpss-pci.c
pwm-lpss-platform.c
pwm-lpss.c
pwm-lpss.h
pwm-mediatek.c
pwm-meson.c
pwm-mtk-disp.c pwm: mtk-disp: Implement atomic API .get_state() 2021-09-02 22:27:46 +02:00
pwm-mxs.c
pwm-ntxec.c
pwm-omap-dmtimer.c pwm: omap-dmtimer: Don't check the return code of pwmchip_remove() 2021-09-02 21:38:52 +02:00
pwm-pca9685.c pwm: pca9685: Don't check the return code of pwmchip_remove() 2021-09-02 21:38:53 +02:00
pwm-pxa.c
pwm-raspberrypi-poe.c
pwm-rcar.c pwm: rcar: Don't check the return code of pwmchip_remove() 2021-09-02 21:38:53 +02:00
pwm-renesas-tpu.c pwm: renesas-tpu: Don't check the return code of pwmchip_remove() 2021-09-02 21:38:54 +02:00
pwm-rockchip.c
pwm-samsung.c pwm: samsung: Don't check the return code of pwmchip_remove() 2021-09-02 21:38:54 +02:00
pwm-sifive.c pwm: sifive: Don't check the return code of pwmchip_remove() 2021-09-02 21:38:55 +02:00
pwm-sl28cpld.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: Don't check the return code of pwmchip_remove() 2021-09-02 21:38:55 +02:00
pwm-tegra.c
pwm-tiecap.c
pwm-tiehrpwm.c
pwm-twl-led.c
pwm-twl.c
pwm-visconti.c
pwm-vt8500.c
sysfs.c