* re: driver core: add test of driver remove calls during probe
@ 2016-10-11 7:17 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2016-10-11 7:17 UTC (permalink / raw)
To: kernel-janitors
Hello Rob Herring,
This is a semi-automatic email about new static checker warnings.
The patch bea5b158ff0d: "driver core: add test of driver remove calls
during probe" from Aug 11, 2016, leads to the following Smatch
complaint:
drivers/base/dd.c:386 really_probe()
warn: variable dereferenced before check 'dev->bus' (see line 373)
drivers/base/dd.c
372
373 if (dev->bus->probe) {
^^^^^^^^^^^^^^^
Old code just dereferenced ->bus without checking.
374 ret = dev->bus->probe(dev);
375 if (ret)
376 goto probe_failed;
377 } else if (drv->probe) {
378 ret = drv->probe(dev);
379 if (ret)
380 goto probe_failed;
381 }
382
383 if (test_remove) {
384 test_remove = false;
385
386 if (dev->bus && dev->bus->remove)
^^^^^^^^
So this test can probably be removed.
387 dev->bus->remove(dev);
388 else if (drv->remove)
regards,
dan carpenter
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-10-11 7:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-11 7:17 driver core: add test of driver remove calls during probe Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).