mirror of
https://github.com/u-boot/u-boot.git
synced 2024-12-05 10:33:42 +08:00
dm: avoid NULL dereference in lists_bind_fdt()
If parameter drv of lists_bind_fdt() is specified, we want to bind to this
specific driver even if its field of_match is NULL.
If entry->of_match is NULL, we should not dereference it in a debug
statement.
Fixes: d3e773613b
("dm: core: Use U-Boot logging instead of pr_debug()")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
59ec024e56
commit
7a6f5a4ea1
@ -241,6 +241,7 @@ int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (entry->of_match)
|
||||||
log_debug(" - found match at '%s': '%s' matches '%s'\n",
|
log_debug(" - found match at '%s': '%s' matches '%s'\n",
|
||||||
entry->name, entry->of_match->compatible,
|
entry->name, entry->of_match->compatible,
|
||||||
id->compatible);
|
id->compatible);
|
||||||
|
Loading…
Reference in New Issue
Block a user