linux-sg2042/drivers/firmware/arm_scmi
Cristian Marussi c7f8852d42 firmware: arm_scmi: Fix late checks on pointer dereference
A few dereferences could happen before the iterator pointer argument was
checked for NULL, causing the following smatch warnings:

drivers/firmware/arm_scmi/driver.c:1214 scmi_iterator_run() warn: variable
dereferenced before check 'i' (see line 1210)

Fix by moving the checks early and dropping some unneeded local references.

No functional change.

Link: https://lore.kernel.org/r/20220503121047.3590340-1-cristian.marussi@arm.com
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2022-05-03 14:23:02 +01:00
..
Kconfig firmware: arm_scmi: Support optee shared memory in the optee transport 2022-04-28 18:22:53 +01:00
Makefile firmware: arm_scmi: Disable ftrace for Clang Thumb2 builds 2022-02-08 23:06:40 +00:00
base.c firmware: arm_scmi: Dynamically allocate implemented protocols array 2022-04-28 18:22:51 +01:00
bus.c bus: Make remove callback return void 2021-07-21 11:53:42 +02:00
clock.c firmware: arm_scmi: Add SCMI v3.1 clock notifications 2022-04-28 18:22:53 +01:00
common.h firmware: arm_scmi: Split protocol specific definitions in a dedicated header 2022-04-28 18:22:51 +01:00
driver.c firmware: arm_scmi: Fix late checks on pointer dereference 2022-05-03 14:23:02 +01:00
mailbox.c firmware: arm_scmi: Add new parameter to mark_txdone 2021-12-21 10:59:38 +00:00
msg.c firmware: arm_scmi: Add message passing abstractions for transports 2021-08-05 10:23:23 +01:00
notify.c firmware: arm_scmi: Fix kernel doc warnings about return values 2021-07-13 11:39:54 +01:00
notify.h firmware: arm_scmi: Remove duplicate declaration of struct scmi_protocol_handle 2021-04-27 11:57:26 +01:00
optee.c firmware: arm_scmi: Support optee shared memory in the optee transport 2022-04-28 18:22:53 +01:00
perf.c firmware: arm_scmi: Add checks for min/max limits in PERFORMANCE_LIMITS_SET 2022-04-28 18:22:53 +01:00
power.c firmware: arm_scmi: Add SCMI v3.1 protocol extended names support 2022-04-28 18:22:52 +01:00
protocols.h firmware: arm_scmi: Add iterators for multi-part commands 2022-04-28 18:22:52 +01:00
reset.c firmware: arm_scmi: Add SCMI v3.1 protocol extended names support 2022-04-28 18:22:52 +01:00
scmi_pm_domain.c firmware: arm_scmi: pm: Propagate return value to caller 2021-11-17 11:24:50 +00:00
sensors.c firmware: arm_scmi: Add SCMI v3.1 SENSOR_AXIS_NAME_GET support 2022-04-28 18:22:52 +01:00
shmem.c firmware: arm_scmi: Rename .clear_notification() transport_ops 2020-04-20 17:25:26 +01:00
smc.c firmware: arm_scmi: Add new parameter to mark_txdone 2021-12-21 10:59:38 +00:00
system.c firmware: arm_scmi: Split protocol specific definitions in a dedicated header 2022-04-28 18:22:51 +01:00
virtio.c firmware: arm_scmi: Add atomic mode support to virtio transport 2022-02-21 10:36:48 +00:00
voltage.c firmware: arm_scmi: Add SCMI v3.1 VOLTAGE_LEVEL_SET_COMPLETE 2022-04-28 18:22:53 +01:00