diff options
author | Oliver Neukum <oneukum@suse.de> | 2008-07-27 14:01:59 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-27 18:07:57 -0300 |
commit | ee56a4d3e39c2baafd06aaf26d975a7c9b05e3a2 (patch) | |
tree | c33575d547a0613eeaaa5c289956cf79925d53fb /drivers/media/video/gspca/gspca.c | |
parent | ee281b856d4e4921da24387ab116bb0855c2efaa (diff) | |
download | blackbird-op-linux-ee56a4d3e39c2baafd06aaf26d975a7c9b05e3a2.tar.gz blackbird-op-linux-ee56a4d3e39c2baafd06aaf26d975a7c9b05e3a2.zip |
V4L/DVB (8544): 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 <oneukum@suse.de>
Acked-by: Hans de Goede <j.w.r.degoede@hhs.nl>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/gspca/gspca.c')
-rw-r--r-- | drivers/media/video/gspca/gspca.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index bc301bae0482..3a051c925ff6 100644 --- a/drivers/media/video/gspca/gspca.c +++ b/drivers/media/video/gspca/gspca.c @@ -1758,6 +1758,7 @@ int gspca_dev_probe(struct usb_interface *intf, 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); @@ -1766,7 +1767,6 @@ int gspca_dev_probe(struct usb_interface *intf, goto out; } - gspca_dev->present = 1; usb_set_intfdata(intf, gspca_dev); PDEBUG(D_PROBE, "probe ok"); return 0; |