Hello,

The function usbioctl() has an error variable and two more which
are declared in nested blocks, i.e. switch cases for USB_REQUEST
and USB_DEVICE_GET_FDESC. The following patch to remove the
nested declarations builds cleanly, and if I'm following things
correctly the function works the same without them. Sorry if I
got it wrong.

- Michael

Index: usb.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/usb.c,v
retrieving revision 1.119
diff -u -p -u -r1.119 usb.c
--- usb.c       1 May 2018 18:14:46 -0000       1.119
+++ usb.c       31 Jul 2018 09:37:21 -0000
@@ -623,7 +623,6 @@ usbioctl(dev_t devt, u_long cmd, caddr_t
                void *ptr = NULL;
                int addr = ur->ucr_addr;
                usbd_status err;
-               int error = 0;
 
                if (!(flag & FWRITE))
                        return (EBADF);
@@ -777,7 +776,6 @@ usbioctl(dev_t devt, u_long cmd, caddr_t
                struct iovec iov;
                struct uio uio;
                size_t len;
-               int error;
 
                if (addr < 1 || addr >= USB_MAX_DEVICES)
                        return (EINVAL);

Reply via email to