mirror-linux/include/linux/firmware
Krzysztof Kozlowski a2be37eedb firmware: exynos-acpm: Drop fake 'const' on handle pointer
All the functions operating on the 'handle' pointer are claiming it is a
pointer to const thus they should not modify the handle.  In fact that's
a false statement, because first thing these functions do is drop the
cast to const with container_of:

  struct acpm_info *acpm = handle_to_acpm_info(handle);

And with such cast the handle is easily writable with simple:

  acpm->handle.ops.pmic_ops.read_reg = NULL;

The code is not correct logically, either, because functions like
acpm_get_by_node() and acpm_handle_put() are meant to modify the handle
reference counting, thus they must modify the handle.  Modification here
happens anyway, even if the reference counting is stored in the
container which the handle is part of.

The code does not have actual visible bug, but incorrect 'const'
annotations could lead to incorrect compiler decisions.

Fixes: a88927b534 ("firmware: add Exynos ACPM protocol driver")
Cc: stable@vger.kernel.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20260224104203.42950-2-krzysztof.kozlowski@oss.qualcomm.com
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
2026-02-28 15:47:03 +01:00
..
broadcom
cirrus firmware: cs_dsp: mock_bin: Add function to create long-offset patches 2026-01-05 13:18:28 +00:00
imx ASoC: fsl_sai: Add AUDMIX mode support on i.MX952 2026-01-26 12:09:19 +00:00
intel firmware: stratix10-svc: fix make htmldocs warning 2025-11-24 17:49:12 +01:00
mediatek
meson
qcom firmware: qcom_scm: Add qcom_scm_pas_get_rsc_table() to get resource table 2026-01-13 12:14:34 -06:00
samsung firmware: exynos-acpm: Drop fake 'const' on handle pointer 2026-02-28 15:47:03 +01:00
thead
trusted_foundations.h
xlnx-event-manager.h
xlnx-zynqmp-crypto.h firmware: xilinx: Add firmware API's to support aes-gcm in Versal device 2026-01-23 13:48:43 +08:00
xlnx-zynqmp-ufs.h scsi: firmware: xilinx: Add APIs for UFS PHY initialization 2025-10-29 23:00:48 -04:00
xlnx-zynqmp.h firmware: zynqmp: Move crypto API's to separate file 2026-01-23 13:48:43 +08:00