diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 1b1cbb571d38d7..9a1e9704d78203 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -283,6 +283,7 @@ static int really_probe(struct device *dev, struct device_driver *drv) devres_release_all(dev); driver_sysfs_remove(dev); dev->driver = NULL; + dev_set_drvdata(dev, NULL); if (ret == -EPROBE_DEFER) { /* Driver requested deferred probing */ @@ -487,6 +488,7 @@ static void __device_release_driver(struct device *dev) drv->remove(dev); devres_release_all(dev); dev->driver = NULL; + dev_set_drvdata(dev, NULL); klist_remove(&dev->p->knode_driver); if (dev->bus) blocking_notifier_call_chain(&dev->bus->p->bus_notifier,