extending BKL in v4l open
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 renamed from videodev.c.alt +4 -3
@@ -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 ();