Skip to content

Commit

Permalink
bus: mvebu-mbus: potential forever loop in mvebu_mbus_init()
Browse files Browse the repository at this point in the history
"of_id->compatible" is an array and not a pointer so it can never be
NULL.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
  • Loading branch information
Dan Carpenter authored and Jason Cooper committed Nov 24, 2013
1 parent 6ce4eac commit 7663cfd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/bus/mvebu-mbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 7663cfd

Please sign in to comment.