mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oliver Neukum <Oliver.Neukum@lrz.uni-muenchen.de>
To: linux-usb-devel@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org
Subject: extending BKL in v4l open
Date: Wed, 22 Aug 2001 17:13:43 +0200	[thread overview]
Message-ID: <200108221524.RAA27973@ns.cablesurf.de> (raw)

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

                 reply	other threads:[~2001-08-22 15:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200108221524.RAA27973@ns.cablesurf.de \
    --to=oliver.neukum@lrz.uni-muenchen.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®