V4L/DVB (9690): gspca: Lock the subdrivers via module_get/put.

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5c4fa002b1c7b40f65fa911ae17a823ec9e26ab2
Commit:     5c4fa002b1c7b40f65fa911ae17a823ec9e26ab2
Parent:     98522a7be97f2b23451342e36c39f412f0461e24
Author:     Jean-Francois Moine <moinejf <at> free.fr>
AuthorDate: Tue Nov 18 15:52:31 2008 -0300
Committer:  Mauro Carvalho Chehab <mchehab <at> redhat.com>
CommitDate: Mon Nov 24 12:01:23 2008 -0200

    V4L/DVB (9690): gspca: Lock the subdrivers via module_get/put.

    The previous subdriver protection against rmmod was done via the
    file operations table in the device descriptor. On device disconnection
    while streaming, the device structure was freed at close time, and the
    module_put still used the module name in the freed area.
    Now, explicit module get/put are done on open and close.

    Signed-off-by: Jean-Francois Moine <moinejf <at> free.fr>
    Signed-off-by: Mauro Carvalho Chehab <mchehab <at> redhat.com>
---
 drivers/media/video/gspca/gspca.c |   13 ++++++++++---
 drivers/media/video/gspca/gspca.h |    2 +-
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index f28d2f4..a565f37 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -874,6 +874,13 @@ static int dev_open(struct inode *inode, struct file *file)
 		ret = -EBUSY;
 		goto out;
(Continue reading)


Gmane