firmware: smci: possible NULL dereference
sandbox_scmi_devices_ctx() may return NULL. We should not dereference this value in sandbox_scmi_devices_remove(). The problem was indicated by 'gcc-11 -fanalyzer'. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
c30a7093e8
commit
6f5edbaf93
@ -50,6 +50,9 @@ static int sandbox_scmi_devices_remove(struct udevice *dev)
|
||||
int ret = 0;
|
||||
size_t n;
|
||||
|
||||
if (!devices)
|
||||
return 0;
|
||||
|
||||
for (n = 0; n < SCMI_TEST_DEVICES_RD_COUNT; n++) {
|
||||
int ret2 = reset_free(devices->reset + n);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user