Merge tag 'locks-v4.4-1' of git://git.samba.org/jlayton/linux
[firefly-linux-kernel-4.4.55.git] / tools / usb / usbip / src / usbip_detach.c
index 05c6d15856eb649d1b1e46e685988ebb1accdb46..9db9d21bb2ecee75c89c027ccb07cfdeb21062de 100644 (file)
@@ -47,7 +47,9 @@ static int detach_port(char *port)
        uint8_t portnum;
        char path[PATH_MAX+1];
 
-       for (unsigned int i = 0; i < strlen(port); i++)
+       unsigned int port_len = strlen(port);
+
+       for (unsigned int i = 0; i < port_len; i++)
                if (!isdigit(port[i])) {
                        err("invalid port %s", port);
                        return -1;