android_kernel_motorola_sm6225/drivers/reset
Geert Uytterhoeven d2939b197d reset: Fix crash when freeing non-existent optional resets
[ 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: 17c82e206d ("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>
2024-01-08 11:27:33 +01:00
..
hisilicon
sti
tegra reset: tegra-bpmp: Restore Handle errors in BPMP response 2022-04-27 13:39:43 +02:00
core.c reset: Fix crash when freeing non-existent optional resets 2024-01-08 11:27:33 +01:00
Kconfig
Makefile
reset-a10sr.c
reset-ath79.c
reset-axs10x.c
reset-berlin.c
reset-hsdk.c
reset-imx7.c
reset-lantiq.c
reset-lpc18xx.c
reset-meson-audio-arb.c
reset-meson.c
reset-oxnas.c
reset-pistachio.c
reset-qcom-aoss.c
reset-simple.c
reset-simple.h
reset-stm32mp1.c
reset-sunxi.c
reset-ti-sci.c
reset-ti-syscon.c reset: ti-syscon: fix to_ti_syscon_reset_data macro 2021-07-28 11:13:42 +02:00
reset-uniphier-usb3.c
reset-uniphier.c
reset-zynq.c