diff options
| author | riastradh <riastradh@NetBSD.org> | 2022-09-13 09:47:17 +0000 |
|---|---|---|
| committer | riastradh <riastradh@NetBSD.org> | 2022-09-13 09:47:17 +0000 |
| commit | f8313c4359699ce4cd36f3caec2adfd4ee59a34a (patch) | |
| tree | 2c6c18a71299ef5e118d1f184b12813afc0b1945 /sys/dev | |
| parent | 22bfba8a6be5826efc441df367e66537390f1f9a (diff) | |
usbdi(9): Rule out possible race to read xfer->ux_status.
I think this might actually be safe, because when it's synchronous,
the xfer can't be reused except by the caller after usbd_transfer
returns. But let's make it definitely not wrong instead of maybe
actually safe.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/usb/usbdi.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c index 5730925ea5f..841249e6d9f 100644 --- a/sys/dev/usb/usbdi.c +++ b/sys/dev/usb/usbdi.c @@ -1,4 +1,4 @@ -/* $NetBSD: usbdi.c,v 1.244 2022/09/07 10:41:34 riastradh Exp $ */ +/* $NetBSD: usbdi.c,v 1.245 2022/09/13 09:47:17 riastradh Exp $ */ /* * Copyright (c) 1998, 2012, 2015 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.244 2022/09/07 10:41:34 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.245 2022/09/13 09:47:17 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -501,10 +501,10 @@ usbd_transfer(struct usbd_xfer *xfer) break; } } - SDT_PROBE2(usb, device, xfer, done, xfer, xfer->ux_status); - /* XXX Race to read xfer->ux_status? */ + err = xfer->ux_status; + SDT_PROBE2(usb, device, xfer, done, xfer, err); usbd_unlock_pipe(pipe); - return xfer->ux_status; + return err; } /* Like usbd_transfer(), but waits for completion. */ |
