git.openpandora.org
/
pandora-u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c30a709
)
firmware: smci: possible NULL dereference
author
Heinrich Schuchardt
<xypron.glpk@gmx.de>
Mon, 1 Feb 2021 02:01:54 +0000
(
03:01
+0100)
committer
Simon Glass
<sjg@chromium.org>
Wed, 3 Feb 2021 10:38:41 +0000
(
03:38
-0700)
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>
drivers/firmware/scmi/sandbox-scmi_devices.c
patch
|
blob
|
history
diff --git
a/drivers/firmware/scmi/sandbox-scmi_devices.c
b/drivers/firmware/scmi/sandbox-scmi_devices.c
index
414da6f
..
1a6fafb
100644
(file)
--- a/
drivers/firmware/scmi/sandbox-scmi_devices.c
+++ b/
drivers/firmware/scmi/sandbox-scmi_devices.c
@@
-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);