mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* extending BKL in v4l open
@ 2001-08-22 15:13 Oliver Neukum
  0 siblings, 0 replies; only message in thread
From: Oliver Neukum @ 2001-08-22 15:13 UTC (permalink / raw)
  To: linux-usb-devel; +Cc: linux-kernel

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();

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-08-22 15:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-22 15:13 extending BKL in v4l open Oliver Neukum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®