diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2015-06-18 11:41:03 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-08-10 12:21:57 -0700 |
commit | 35c8bade335f6d747f4567cfa5b678b6798a2187 (patch) | |
tree | ebc9312af97f5d85089508aa1d04306f064deb4a | |
parent | 81b75e85593dcbfde8a86cd44bd75cc96a22849e (diff) |
mei: prevent unloading mei hw modules while the device is opened.
commit 154322f47376fed6ab1e4b350aa45fffa15a61aa upstream.
chrdev_open() increases reference counter on cdev->owner. Instead of
assigning the owner to mei subsystem, the owner has to be set to the
underlaying HW module (mei_me or mei_txe), so once the device is opened
the HW module cannot be unloaded.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/misc/mei/main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c index 3e2968159506..e40bcd03bd47 100644 --- a/drivers/misc/mei/main.c +++ b/drivers/misc/mei/main.c @@ -685,7 +685,7 @@ int mei_register(struct mei_device *dev, struct device *parent) /* Fill in the data structures */ devno = MKDEV(MAJOR(mei_devt), dev->minor); cdev_init(&dev->cdev, &mei_fops); - dev->cdev.owner = mei_fops.owner; + dev->cdev.owner = parent->driver->owner; /* Add the device */ ret = cdev_add(&dev->cdev, devno, 1); |