summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeinrich Schuchardt <[email protected]>2022-07-10 15:40:22 +0200
committerSimon Glass <[email protected]>2022-07-26 02:30:56 -0600
commit53fbaa4a4ae1dde1f83b2dda39ccf70a0b69373d (patch)
treebff27ae5e9e4b1ceb7f550e29274f13ca2b546e2
parent6e15cda270a060cf87c6c643a1cc3da65ffb242d (diff)
dm: avoid NULL dereference in add_item()
acpi_add_other_item() passes dev = NULL. Instead of dev->name write the string "other" to the debug log: ACPI: Writing ACPI tables at 1fd3000 0base: writing table '<NULL>' * other: Added type 3, 0000000011fd4000, size 240 1facs: writing table 'FACS' * other: Added type 3, 0000000011fd4240, size 40 5csrt: writing table 'CSRT' * other: Added type 3, 0000000011fd4280, size 30 Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Simon Glass <[email protected]>
-rw-r--r--drivers/core/acpi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/core/acpi.c b/drivers/core/acpi.c
index 0df58dbc0d9..8457733edb5 100644
--- a/drivers/core/acpi.c
+++ b/drivers/core/acpi.c
@@ -159,8 +159,8 @@ static int add_item(struct acpi_ctx *ctx, struct udevice *dev,
memcpy(item->buf, start, item->size);
}
item_count++;
- log_debug("* %s: Added type %d, %p, size %x\n", dev->name, type, start,
- item->size);
+ log_debug("* %s: Added type %d, %p, size %x\n",
+ dev ? dev->name : "other", type, start, item->size);
return 0;
}