Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1499171
| From | Rob Herring <robh@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 2/2] driver core: fix smatch warning on dev->bus check |
| Date | 2016-10-11 21:50 +0200 |
| Message-ID | <srbdM-2oc-21@gated-at.bofh.it> (permalink) |
| References | <srbdL-2oc-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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 <dan.carpenter@oracle.com>
Signed-off-by: Rob Herring <robh@kernel.org>
---
drivers/base/dd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 8937a7ad7165..d76cd97a98b6 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -384,7 +384,7 @@ static int really_probe(struct device *dev, struct device_driver *drv)
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);
--
2.10.0
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 1/2] driver core: skip removal test for non-removable drivers Rob Herring <robh@kernel.org> - 2016-10-11 21:50 +0200 [PATCH 2/2] driver core: fix smatch warning on dev->bus check Rob Herring <robh@kernel.org> - 2016-10-11 21:50 +0200 Re: [PATCH 1/2] driver core: skip removal test for non-removable drivers Laszlo Ersek <lersek@redhat.com> - 2016-10-12 09:20 +0200
csiph-web