diff options
author | Oliver Neukum <oneukum@suse.de> | 2014-05-19 07:52:20 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-27 19:03:58 -0400 |
commit | c78d1ecfd7e639f21c7a809f4df6de1a644a91f0 (patch) | |
tree | e97d8999e4a7dc159f26153fc56fc76d746dc874 /drivers/usb/misc/yurex.c | |
parent | 552e1f2679b7b766b8b8de3dc6d83d9cd28f28b2 (diff) |
USB: yurex: fix race between probe() and read()
There's a window during which read() would return 0 instead
of a correct error for no data yet. Reorder initialization
to fix the race.
Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/misc/yurex.c')
-rw-r--r-- | drivers/usb/misc/yurex.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/usb/misc/yurex.c b/drivers/usb/misc/yurex.c index 24278208bf74..1472805083de 100644 --- a/drivers/usb/misc/yurex.c +++ b/drivers/usb/misc/yurex.c | |||
@@ -296,6 +296,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ | |||
296 | 296 | ||
297 | /* save our data pointer in this interface device */ | 297 | /* save our data pointer in this interface device */ |
298 | usb_set_intfdata(interface, dev); | 298 | usb_set_intfdata(interface, dev); |
299 | dev->bbu = -1; | ||
299 | 300 | ||
300 | /* we can register the device now, as it is ready */ | 301 | /* we can register the device now, as it is ready */ |
301 | retval = usb_register_dev(interface, &yurex_class); | 302 | retval = usb_register_dev(interface, &yurex_class); |
@@ -306,8 +307,6 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ | |||
306 | goto error; | 307 | goto error; |
307 | } | 308 | } |
308 | 309 | ||
309 | dev->bbu = -1; | ||
310 | |||
311 | dev_info(&interface->dev, | 310 | dev_info(&interface->dev, |
312 | "USB YUREX device now attached to Yurex #%d\n", | 311 | "USB YUREX device now attached to Yurex #%d\n", |
313 | interface->minor); | 312 | interface->minor); |