Skip to content

Commit

Permalink
Revert "base: dd: don't remove driver_data in -EPROBE_DEFER case"
Browse files Browse the repository at this point in the history
This reverts commit ded9db3.

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 <[email protected]>
Cc: Yi Zhang <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
gregkh committed May 3, 2016
1 parent cc73660 commit c6e360a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/base/dd.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,7 @@ static int really_probe(struct device *dev, struct device_driver *drv)
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);
Expand Down

0 comments on commit c6e360a

Please sign in to comment.