extending BKL in v4l open

Oliver Neukum (Oliver.Neukum@lrz.uni-muenchen.de)
Wed, 22 Aug 2001 17:13:43 +0200


Hi,

I'd like to propose an extension of code under the BKL in v4l's open method
to include the actual open of the low level v4l driver. Otherwise there's a
race with usb v4l drivers which deregister themselves as v4l devices upon
being disconnected on usb, as the pointer passed may point to freed memory.

Regards
Oliver

--- videodev.c.alt Sun Aug 12 19:38:48 2001
+++ videodev.c Wed Aug 22 17:07:51 2001
@@ -164,8 +164,7 @@

if(vfl->owner)
__MOD_INC_USE_COUNT(vfl->owner);
- unlock_kernel();
-
+
if(vfl->open)
{
err=vfl->open(vfl,0); /* Tell the device it is open */
@@ -174,10 +173,12 @@
vfl->busy=0;
if(vfl->owner)
__MOD_DEC_USE_COUNT(vfl->owner);
-
+
+ unlock_kernel();
return err;
}
}
+ unlock_kernel();
return 0;
error_out:
unlock_kernel();
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/