Skip to content

Commit

Permalink
mei: prevent unloading mei hw modules while the device is opened.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tomas Winkler authored and Greg Kroah-Hartman committed Jul 23, 2015
1 parent a634443 commit 154322f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/misc/mei/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,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);
Expand Down

0 comments on commit 154322f

Please sign in to comment.