diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2008-07-27 19:01:59 +0200 |
---|---|---|
committer | Jean-Francois Moine <moinejf@free.fr> | 2008-07-27 19:01:59 +0200 |
commit | 7badc67bd1dbbce7a96802f2aba9fa94695a70d4 (patch) | |
tree | 7440cca09967e28d91d8e3456b94b7b3cdcf95e6 /linux/drivers/media/video | |
parent | 6c3a536a4c83388df468f1e2948bb0a03d93b949 (diff) | |
download | mediapointer-dvb-s2-7badc67bd1dbbce7a96802f2aba9fa94695a70d4.tar.gz mediapointer-dvb-s2-7badc67bd1dbbce7a96802f2aba9fa94695a70d4.tar.bz2 |
gspca: probe/open race.
From: Oliver Neukum <oneukum@suse.de>
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>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r-- | linux/drivers/media/video/gspca/gspca.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/linux/drivers/media/video/gspca/gspca.c b/linux/drivers/media/video/gspca/gspca.c index 3c4ce567f..ffa2d7de0 100644 --- a/linux/drivers/media/video/gspca/gspca.c +++ b/linux/drivers/media/video/gspca/gspca.c @@ -1765,6 +1765,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); @@ -1773,7 +1774,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; |