bus: mvebu-mbus: potential forever loop in mvebu_mbus_init()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 13 Nov 2013 07:50:24 +0000 (10:50 +0300)
committerJason Cooper <jason@lakedaemon.net>
Sun, 24 Nov 2013 13:03:00 +0000 (13:03 +0000)
"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>
drivers/bus/mvebu-mbus.c

index 2394e9753ef56b47e93d91bd7499eeb657c51383..c646a769e1f51f2e27fe619fb16f9f7d5f6eb907 100644 (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;
        }