mwifiex: check if mwifiex_sdio_probe_of() fails and return error
authorJavier Martinez Canillas <javier@osg.samsung.com>
Fri, 27 May 2016 14:18:20 +0000 (10:18 -0400)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 16 Jun 2016 15:05:08 +0000 (18:05 +0300)
The function can fail so the returned value should be checked
and the error propagated to the caller in case of a failure.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/mwifiex/sdio.c

index e9d90766567f10873b1fdeae4989ddbb4c8b0888..c38d14f52643077c2a29fb4111c400bd3fc9ad4d 100644 (file)
@@ -187,8 +187,13 @@ mwifiex_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id)
        }
 
        /* device tree node parsing and platform specific configuration*/
-       if (func->dev.of_node)
-               mwifiex_sdio_probe_of(&func->dev, card);
+       if (func->dev.of_node) {
+               ret = mwifiex_sdio_probe_of(&func->dev, card);
+               if (ret) {
+                       dev_err(&func->dev, "SDIO dt node parse failed\n");
+                       goto err_disable;
+               }
+       }
 
        ret = mwifiex_add_card(card, &add_remove_card_sem, &sdio_ops,
                               MWIFIEX_SDIO);