diff options
| author | mrg <mrg@NetBSD.org> | 2019-08-24 07:43:00 +0000 |
|---|---|---|
| committer | mrg <mrg@NetBSD.org> | 2019-08-24 07:43:00 +0000 |
| commit | 86f792d08eb2908993dba1625399800a9a54def5 (patch) | |
| tree | 25f4e22a04c9bcda7fa2fef086a8c7195ef42637 /sys/dev | |
| parent | 2d5847902b886d9c1e68966b3fbcf0fb2bc105c4 (diff) | |
don't try to deref a maybe-NULL pointer. instead of logging
potentially garbage (if not NULL), log the request length.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/usb/usbdi.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c index a6dd3370c3a..ce3319f7994 100644 --- a/sys/dev/usb/usbdi.c +++ b/sys/dev/usb/usbdi.c @@ -1,4 +1,4 @@ -/* $NetBSD: usbdi.c,v 1.184 2019/08/22 07:38:06 mrg Exp $ */ +/* $NetBSD: usbdi.c,v 1.185 2019/08/24 07:43:00 mrg 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.184 2019/08/22 07:38:06 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.185 2019/08/24 07:43:00 mrg Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -1102,14 +1102,14 @@ usbd_do_request_flags(struct usbd_device *dev, usb_device_request_t *req, { struct usbd_xfer *xfer; usbd_status err; + size_t len = UGETW(req->wLength); USBHIST_FUNC(); USBHIST_CALLARGS(usbdebug, "dev=%#jx req=%jx flgas=%jx len=%jx", - (uintptr_t)dev, (uintptr_t)req, flags, *actlen); + (uintptr_t)dev, (uintptr_t)req, flags, len); ASSERT_SLEEPABLE(); - size_t len = UGETW(req->wLength); int error = usbd_create_xfer(dev->ud_pipe0, len, 0, 0, &xfer); if (error) return error; |
