public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Please review patchlet for ov511 (2.4.2-ac19)
@ 2001-03-23  4:21 Pete Zaitcev
  0 siblings, 0 replies; only message in thread
From: Pete Zaitcev @ 2001-03-23  4:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Pete Zaitcev

Here is the deal:

we have a guy here with a webcam and the following scenario:
1. ov511 disconnects, everything dies/releases/closes fine,
2. webcam soft starts polling open/sleep/open/sleep/...
3. ov511_probe works and reaches ov511_configure,
   calls video_register_device().
4. Webcam software opens and oopses on the semafore
   that was not initialized yet.

I think video_register_device needs to be done last, when
everything else is ready to accept appliction requests.

Someone please review. The error handling style
of ov511 spins my head. I may be missing a code path somewhere.

Thanks in advance,
-- Pete

--- linux-2.4.2-ac19/drivers/usb/ov511.c	Thu Jan  4 13:15:32 2001
+++ linux-2.4.2-ac19-p3/drivers/usb/ov511.c	Thu Mar 22 19:55:59 2001
@@ -3141,11 +3141,6 @@
 
 	init_waitqueue_head(&ov511->wq);
 
-	if (video_register_device(&ov511->vdev, VFL_TYPE_GRABBER) < 0) {
-		err("video_register_device failed");
-		return -EBUSY;
-	}
-
 	if (ov511_write_regvals(dev, aRegvalsInit)) goto error;
 	if (ov511_write_regvals(dev, aRegvalsNorm511)) goto error;
 
@@ -3214,7 +3209,6 @@
 	return 0;
 	
 error:
-	video_unregister_device(&ov511->vdev);
 	usb_driver_release_interface(&ov511_driver,
 		&dev->actconfig->interface[ov511->iface]);
 
@@ -3323,6 +3317,11 @@
 		ov511->buf_state = BUF_NOT_ALLOCATED;
 	} else {
 		err("Failed to configure camera");
+		goto error;
+	}
+
+	if (video_register_device(&ov511->vdev, VFL_TYPE_GRABBER) < 0) {
+		err("video_register_device failed");
 		goto error;
 	}
 

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

only message in thread, other threads:[~2001-03-23  4:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-03-23  4:21 Please review patchlet for ov511 (2.4.2-ac19) Pete Zaitcev

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