summaryrefslogtreecommitdiff
path: root/drivers/firmware/arm_scmi/vendors
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-11-25 11:33:12 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2026-11-25 11:33:12 -0800
commitebb7a8dc1e74c705daffe11c2faf38ec2628f838 (patch)
tree23df29183aa5d67fe3289e3f0d6b3bd8eca00bbf /drivers/firmware/arm_scmi/vendors
parentf441d24349a3fb7f0b0f8f76f05686e448fd0b10 (diff)
parent30275e284469c6f8bb2e1bf7a666b065a81b46c9 (diff)
Merge tag 'soc-fixes-7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/socHEADmaster
Pull SoC fixes from Arnd Bergmann: "There are once more lots of individual device driver fixes across several subsystems, and most of them look like they were found with the help of LLM services looking more closely at corner cases that had been missed before: - Multiple SCMI firmware fixes for probing device nodes and mailboxes - Notifications on Arm FFA firmware with hash conflicts - Out-of-bounds access to i.MX SCMI firmware data from userspace - Several error handling and probe fixes for reset controllers, along with a circular locking problem and one NULL pointer dereference - Multiple error handling fixes for memory controller drivers - A probe order fix for Raspberry Pi firmware For the devicetree source files, there are relatively few fixes so far, mainly for Samsung and ST SoC based machines, and mainly covering broken functionality: - Suspend issues across ST SoCs - Boot time panic on one ST based board from accessing firmware memory - One revert for a regression caused by enabling IOMMU for USB on an i.MX8 based board - Corrections for harmless mismatches to the actual boards from Arm and ST - Broken Bluetooth and/or Wi-Fi on older Samsung Exynos based products" * tag 'soc-fixes-7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (40 commits) ARM: dts: stm32: Fix STM32MP15xx DHCOM SoM PicoITX overlay application arm64: dts: st: mark STM32MP23 timer as stopping in suspend arm64: dts: st: add PSCI idle state to STM32MP23 CPU domains arm64: dts: st: add PSCI idle state to STM32MP25 CPU domains arm64: dts: st: Update gpio-line-names on STM32MP23xx DHCOS SoM arm64: dts: st: Move Bluetooth to USART2 on STM32MP23xx DHCOS SoM arm64: dts: st: add firmware reserved memory to Engicam MicroGEA-STM32MP257 reset: core: honour optional resets when the GPIO fallback returns -ENOENT platform/raspberrypi: vchiq: register bus at subsys_initcall MAINTAINERS: fix bouncing {sbranden,rjui}@broadcom.com Revert "arm64: dts: imx8qm-ss-conn: add usbotg3 iommu information" memory: fsl_ifc: Do not dereference the unset global pointer in probe reset: Fix circular locking dependency in reset_controller_unregister() reset: Fix reset_control leak when put after controller unregister reset: spacemit: Fix the RCPU2 PWM reset registers reset: scmi: Set the device for the reset controller memory: fsl_ifc: Clear fsl_ifc_ctrl_dev on probe failure and removal ARM: dts: samsung: exynos4210-trats: fix BCM4330 Bluetooth GPIOs ARM: dts: samsung: exynos4210-universal_c210: fix BCM4330 Bluetooth GPIOs ARM: dts: samsung: exynos4412-p4note: allow powering off the wifi card ...
Diffstat (limited to 'drivers/firmware/arm_scmi/vendors')
-rw-r--r--drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c b/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c
index 2cec3dbb56ad..ed7499d72f19 100644
--- a/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c
+++ b/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c
@@ -273,10 +273,16 @@ static int scmi_imx_misc_ctrl_get(const struct scmi_protocol_handle *ph,
{
struct scmi_imx_misc_ctrl_get_out *out;
struct scmi_xfer *t;
+ u32 num_values, max_values;
int ret, i;
int max_msg_size = ph->hops->get_max_msg_size(ph);
int max_num = (max_msg_size - sizeof(*out)) / sizeof(__le32);
+ if (!num || !val || !*num)
+ return -EINVAL;
+
+ max_values = *num;
+
ret = scmi_imx_misc_ctrl_validate_id(ph, ctrl_id);
if (ret)
return ret;
@@ -290,16 +296,18 @@ static int scmi_imx_misc_ctrl_get(const struct scmi_protocol_handle *ph,
ret = ph->xops->do_xfer(ph, t);
if (!ret) {
out = t->rx.buf;
- *num = le32_to_cpu(out->num);
+ num_values = le32_to_cpu(out->num);
- if (*num >= max_num ||
- *num * sizeof(__le32) > t->rx.len - sizeof(__le32)) {
+ if (num_values > max_values || num_values >= max_num ||
+ num_values * sizeof(__le32) > t->rx.len - sizeof(__le32)) {
ph->xops->xfer_put(ph, t);
return -EINVAL;
}
- for (i = 0; i < *num; i++)
+ for (i = 0; i < num_values; i++)
val[i] = le32_to_cpu(out->val[i]);
+
+ *num = num_values;
}
ph->xops->xfer_put(ph, t);
@@ -438,7 +446,7 @@ static int iter_misc_syslog_update_state(struct scmi_iterator_state *st,
st->num_returned = RETURNED(r->numlogflags);
st->num_remaining = REMAINING(r->numlogflags);
- *p->size = st->num_returned + st->num_remaining;
+ *p->size = st->desc_index + st->num_returned;
return 0;
}