]> Git Repo - linux.git/commitdiff
driver core: fix smatch warning on dev->bus check
authorRob Herring <[email protected]>
Tue, 11 Oct 2016 18:41:03 +0000 (13:41 -0500)
committerGreg Kroah-Hartman <[email protected]>
Mon, 31 Oct 2016 15:15:22 +0000 (09:15 -0600)
Commit d42a09802174 (driver core: skip removal test for non-removable
drivers) introduced a smatch warning:

drivers/base/dd.c:386 really_probe()
         warn: variable dereferenced before check 'dev->bus' (see line 373)

Fix the warning by removing the dev->bus NULL check. dev->bus will never
be NULL, so the check was unnecessary.

Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Rob Herring <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/base/dd.c

index 8937a7ad71650b209af78a7663979a6c8a4f5702..d76cd97a98b6badff85740180dfec97c8966754a 100644 (file)
@@ -384,7 +384,7 @@ re_probe:
        if (test_remove) {
                test_remove = false;
 
-               if (dev->bus && dev->bus->remove)
+               if (dev->bus->remove)
                        dev->bus->remove(dev);
                else if (drv->remove)
                        drv->remove(dev);
This page took 0.075383 seconds and 4 git commands to generate.