631205f094
[ Upstream commit 4a6756f56bcf8e64c87144a626ce53aea4899c0e ] When obtaining one or more optional resets, non-existent resets are stored as NULL pointers, and all related error and cleanup paths need to take this into account. Currently only reset_control_put() and reset_control_bulk_put() get this right. All of __reset_control_bulk_get(), of_reset_control_array_get(), and reset_control_array_put() lack the proper checking, causing NULL pointer dereferences on failure or release. Fix this by moving the existing check from reset_control_bulk_put() to __reset_control_put_internal(), so it applies to all callers. The double check in reset_control_put() doesn't hurt. Fixes: 17c82e206d2a3cd8 ("reset: Add APIs to manage array of resets") Fixes: 48d71395896d54ee ("reset: Add reset_control_bulk API") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/2440edae7ca8534628cdbaf559ded288f2998178.1701276806.git.geert+renesas@glider.be Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sasha Levin <sashal@kernel.org> |
||
---|---|---|
.. | ||
hisilicon | ||
sti | ||
tegra | ||
core.c | ||
Kconfig | ||
Makefile | ||
reset-a10sr.c | ||
reset-ath79.c | ||
reset-axs10x.c | ||
reset-berlin.c | ||
reset-brcmstb-rescal.c | ||
reset-brcmstb.c | ||
reset-hsdk.c | ||
reset-imx7.c | ||
reset-intel-gw.c | ||
reset-lantiq.c | ||
reset-lpc18xx.c | ||
reset-meson-audio-arb.c | ||
reset-meson.c | ||
reset-npcm.c | ||
reset-oxnas.c | ||
reset-pistachio.c | ||
reset-qcom-aoss.c | ||
reset-qcom-pdc.c | ||
reset-raspberrypi.c | ||
reset-scmi.c | ||
reset-simple.c | ||
reset-socfpga.c | ||
reset-stm32mp1.c | ||
reset-sunxi.c | ||
reset-ti-sci.c | ||
reset-ti-syscon.c | ||
reset-uniphier-glue.c | ||
reset-uniphier.c | ||
reset-zynq.c | ||
reset-zynqmp.c |