The patch number 8544 was added via Jean-Francois Moine <[EMAIL PROTECTED]>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        [EMAIL PROTECTED]

------

From: Oliver Neukum  <[EMAIL PROTECTED]>
gspca: probe/open race.


The device is flagged present after it is registered. During that window calls
to open() that should work fail with -ENODEV. Reversing the order fixes
the race.

Signed-off-by: Oliver Neukum <[EMAIL PROTECTED]>
Signed-off-by: Jean-Francois Moine <[EMAIL PROTECTED]>


---

 linux/drivers/media/video/gspca/gspca.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -r cd71b4080a1a -r a19c20d8c144 linux/drivers/media/video/gspca/gspca.c
--- a/linux/drivers/media/video/gspca/gspca.c   Sun Jul 27 14:10:11 2008 -0300
+++ b/linux/drivers/media/video/gspca/gspca.c   Sun Jul 27 19:01:59 2008 +0200
@@ -1765,6 +1765,7 @@ int gspca_dev_probe(struct usb_interface
        memcpy(&gspca_dev->fops, &dev_fops, sizeof gspca_dev->fops);
        gspca_dev->vdev.fops = &gspca_dev->fops;
        gspca_dev->fops.owner = module;         /* module protection */
+       gspca_dev->present = 1;
        ret = video_register_device(&gspca_dev->vdev,
                                  VFL_TYPE_GRABBER,
                                  video_nr);
@@ -1773,7 +1774,6 @@ int gspca_dev_probe(struct usb_interface
                goto out;
        }
 
-       gspca_dev->present = 1;
        usb_set_intfdata(intf, gspca_dev);
        PDEBUG(D_PROBE, "probe ok");
        return 0;


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/a19c20d8c1448f982e3762110d578aa556d1e3a5

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to