Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9d1d459b authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Darren Hart
Browse files

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarDarren Hart <dvhart@linux.intel.com>
parent 51c58f2b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -625,7 +625,10 @@ static void ipc_remove(struct pci_dev *pdev)
{
	struct intel_scu_ipc_dev *scu = pci_get_drvdata(pdev);

	mutex_lock(&ipclock);
	scu->dev = NULL;
	mutex_unlock(&ipclock);

	iounmap(scu->i2c_base);
	intel_scu_devices_destroy();
}