提交 ee56a4d3 编写于 作者: O Oliver Neukum 提交者: Mauro Carvalho Chehab

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: NOliver Neukum <oneukum@suse.de>
Acked-by: NHans de Goede <j.w.r.degoede@hhs.nl>
Signed-off-by: NJean-Francois Moine <moinejf@free.fr>
Signed-off-by: NMauro Carvalho Chehab <mchehab@infradead.org>
上级 ee281b85
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册