Skip to content

Commit 154322f

Browse files
Tomas Winklergregkh
authored andcommitted
mei: prevent unloading mei hw modules while the device is opened.
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. Cc: <stable@vger.kernel.org> #3.17+ 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>
1 parent a634443 commit 154322f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/misc/mei/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ int mei_register(struct mei_device *dev, struct device *parent)
682682
/* Fill in the data structures */
683683
devno = MKDEV(MAJOR(mei_devt), dev->minor);
684684
cdev_init(&dev->cdev, &mei_fops);
685-
dev->cdev.owner = mei_fops.owner;
685+
dev->cdev.owner = parent->driver->owner;
686686

687687
/* Add the device */
688688
ret = cdev_add(&dev->cdev, devno, 1);

0 commit comments

Comments
 (0)