Skip to content

Commit bdacd1b

Browse files
robherringgregkh
authored andcommitted
driver core: fix smatch warning on dev->bus check
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]>
1 parent c5f0627 commit bdacd1b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/base/dd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ static int really_probe(struct device *dev, struct device_driver *drv)
384384
if (test_remove) {
385385
test_remove = false;
386386

387-
if (dev->bus && dev->bus->remove)
387+
if (dev->bus->remove)
388388
dev->bus->remove(dev);
389389
else if (drv->remove)
390390
drv->remove(dev);

0 commit comments

Comments
 (0)