bus: imx-weim: fix NULL but dereferenced coccicheck error
authorWan Jiabing <wanjiabing@vivo.com>
Wed, 23 Feb 2022 03:51:45 +0000 (11:51 +0800)
committerShawn Guo <shawnguo@kernel.org>
Wed, 6 Apr 2022 12:44:20 +0000 (20:44 +0800)
Fix following coccicheck warning:
./drivers/bus/imx-weim.c:355:18-21: ERROR: pdev is NULL but dereferenced.

Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
Acked-by: Ivan Bornyakov <i.bornyakov@metrotek.ru>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
drivers/bus/imx-weim.c

index 60fbd42..2ea0a51 100644 (file)
@@ -352,8 +352,7 @@ static int of_weim_notify(struct notifier_block *nb, unsigned long action,
 
                pdev = of_find_device_by_node(rd->dn);
                if (!pdev) {
-                       dev_err(&pdev->dev,
-                               "Could not find platform device for '%pOF'\n",
+                       pr_err("Could not find platform device for '%pOF'\n",
                                rd->dn);
 
                        ret = notifier_from_errno(-EINVAL);