Most ACPI drivers set driver_data in their .add() callbacks, but usually
they don't clear it in the error code path.
Set driver_data to NULL in acpi_device_probe() to prevent stale pointers
from staying around.
Signed-off-by: Michal Wilczynski <[email protected]>
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <[email protected]>
return -ENOSYS;
ret = acpi_drv->ops.add(acpi_dev);
- if (ret)
+ if (ret) {
+ acpi_dev->driver_data = NULL;
return ret;
+ }
pr_debug("Driver [%s] successfully bound to device [%s]\n",
acpi_drv->name, acpi_dev->pnp.bus_id);