mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
switch: Reset device's drvdata before destroying it
dev_set_drvdata() sets the device specific driver data at dev->p->driver_data. However, dev is destroyed and has it's context memory freed in device_destroy(). As a result, calling dev_set_drvdata() causes a fault when accessing dev->p. Change-Id: I4b1e6d17db52d0e31caf9b52e59979ff9cbb0c12 Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
This commit is contained in:
parent
a515e61bdc
commit
1d36299b6a
1 changed files with 1 additions and 1 deletions
|
@ -151,8 +151,8 @@ void switch_dev_unregister(struct switch_dev *sdev)
|
|||
{
|
||||
device_remove_file(sdev->dev, &dev_attr_name);
|
||||
device_remove_file(sdev->dev, &dev_attr_state);
|
||||
device_destroy(switch_class, MKDEV(0, sdev->index));
|
||||
dev_set_drvdata(sdev->dev, NULL);
|
||||
device_destroy(switch_class, MKDEV(0, sdev->index));
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(switch_dev_unregister);
|
||||
|
||||
|
|
Loading…
Reference in a new issue