Commit 1547853a authored by Alexander Usyskin's avatar Alexander Usyskin Committed by Khalid Elmously

mei: bus: don't clean driver pointer

BugLink: https://bugs.launchpad.net/bugs/1888690

commit e852c2c2 upstream.

It's not needed to set driver to NULL in mei_cl_device_remove()
which is bus_type remove() handler as this is done anyway
in __device_release_driver().

Actually this is causing an endless loop in driver_detach()
on ubuntu patched kernel, while removing (rmmod) the mei_hdcp module.
The reason list_empty(&drv->p->klist_devices.k_list) is always not-empty.
as the check is always true in  __device_release_driver()
	if (dev->driver != drv)
		return;

The non upstream patch is causing this behavior, titled:
'vfio -- release device lock before userspace requests'

Nevertheless the fix is correct also for the upstream.

Link: https://patchwork.ozlabs.org/project/ubuntu-kernel/patch/20180912085046.3401-2-apw@canonical.com/
Cc: <stable@vger.kernel.org>
Cc: Andy Whitcroft <apw@canonical.com>
Signed-off-by: default avatarAlexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Link: https://lore.kernel.org/r/20200628225359.2185929-1-tomas.winkler@intel.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent 52f0ee5c
...@@ -626,9 +626,8 @@ static int mei_cl_device_remove(struct device *dev) ...@@ -626,9 +626,8 @@ static int mei_cl_device_remove(struct device *dev)
ret = cldrv->remove(cldev); ret = cldrv->remove(cldev);
module_put(THIS_MODULE); module_put(THIS_MODULE);
dev->driver = NULL;
return ret;
return ret;
} }
static ssize_t name_show(struct device *dev, struct device_attribute *a, static ssize_t name_show(struct device *dev, struct device_attribute *a,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment