diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2015-10-12 07:19:48 -0400 |
---|---|---|
committer | Darren Hart <dvhart@linux.intel.com> | 2015-10-15 11:23:30 -0400 |
commit | 9d1d459bf52b4a07a934558e055bb61ad82f44cd (patch) | |
tree | 9287729f176fa526c3aaadc99d96144d065fa9a9 /drivers/platform | |
parent | 51c58f2b4f24214950d3dc6ab31af7c2532b096f (diff) |
intel_scu_ipc: Protect dev member assignment on ->remove()
Protect the dev member assignment in ->remove() since user may potentially call
unbind from a sysfs even if the driver is built-in. The latter might be racy
with ongoing SCU communication.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/intel_scu_ipc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c index 9de2029aa909..f94b730540e2 100644 --- a/drivers/platform/x86/intel_scu_ipc.c +++ b/drivers/platform/x86/intel_scu_ipc.c | |||
@@ -625,7 +625,10 @@ static void ipc_remove(struct pci_dev *pdev) | |||
625 | { | 625 | { |
626 | struct intel_scu_ipc_dev *scu = pci_get_drvdata(pdev); | 626 | struct intel_scu_ipc_dev *scu = pci_get_drvdata(pdev); |
627 | 627 | ||
628 | mutex_lock(&ipclock); | ||
628 | scu->dev = NULL; | 629 | scu->dev = NULL; |
630 | mutex_unlock(&ipclock); | ||
631 | |||
629 | iounmap(scu->i2c_base); | 632 | iounmap(scu->i2c_base); |
630 | intel_scu_devices_destroy(); | 633 | intel_scu_devices_destroy(); |
631 | } | 634 | } |