bus: mvebu-mbus: potential forever loop in mvebu_mbus_init()

"of_id->compatible" is an array and not a pointer so it can never be
NULL.

Signed-off-by: Dan Carpenter <[email protected]>
Acked-by: Ezequiel Garcia <[email protected]>
Signed-off-by: Jason Cooper <[email protected]>
This commit is contained in:
Dan Carpenter 2013-11-13 10:50:24 +03:00 • committed by Jason Cooper
commit 7663cfd3f4

View file

@ -734,11 +734,11 @@ int __init mvebu_mbus_init(const char *soc, phys_addr_t mbuswins_phys_base,
{
const struct of_device_id *of_id;
for (of_id = of_mvebu_mbus_ids; of_id->compatible; of_id++)
for (of_id = of_mvebu_mbus_ids; of_id->compatible[0]; of_id++)
if (!strcmp(of_id->compatible, soc))
break;
if (!of_id->compatible) {
if (!of_id->compatible[0]) {
pr_err("could not find a matching SoC family\n");
return -ENODEV;
}