From 280608c88caf3fdf1cdd4f2d102c4feb42baca4b Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 3 May 2016 08:06:06 -0700 Subject: [PATCH] Revert "base: dd: don't remove driver_data in -EPROBE_DEFER case" This reverts commit 8e9a4082677124b7aabdf301022fbc61cabe1a67. Thierry Reding writes: This causes a boot regression on at least one board, caused by one of the drivers looking at driver data to check whether or not the driver has properly loaded. If the code encounters a non-NULL pointer it tries to dereference it, but because it's already been freed there is no memory backing it and things crash. I don't think keeping stale pointers around is a good idea. The whole point of setting this to NULL in the core is so that probe failures result in the same starting conditions no matter what. Can we please get this reverted? Reported-by: Thierry Reding Cc: Yi Zhang Signed-off-by: Greg Kroah-Hartman --- drivers/base/dd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/base/dd.c b/drivers/base/dd.c index dae6cefa60606..16688f50729cf 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -402,8 +402,7 @@ pinctrl_bind_failed: devres_release_all(dev); driver_sysfs_remove(dev); dev->driver = NULL; - if (ret != -EPROBE_DEFER) - dev_set_drvdata(dev, NULL); + dev_set_drvdata(dev, NULL); if (dev->pm_domain && dev->pm_domain->dismiss) dev->pm_domain->dismiss(dev); pm_runtime_reinit(dev); -- 2.39.5