diff --git a/[refs] b/[refs] index e916cba1f384..ddb8650829ee 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2a38e6fcf9173ffa8acf827c0b5d69863e012434 +refs/heads/master: a6bb87522f42aea056585282a70de7512d297323 diff --git a/trunk/drivers/staging/usbip/userspace/src/usbip_detach.c b/trunk/drivers/staging/usbip/userspace/src/usbip_detach.c index 89bf3c195c28..dac5f065755a 100644 --- a/trunk/drivers/staging/usbip/userspace/src/usbip_detach.c +++ b/trunk/drivers/staging/usbip/userspace/src/usbip_detach.c @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -46,6 +47,7 @@ static int detach_port(char *port) { int ret; uint8_t portnum; + char path[PATH_MAX+1]; for (unsigned int i=0; i < strlen(port); i++) if (!isdigit(port[i])) { @@ -57,6 +59,13 @@ static int detach_port(char *port) portnum = atoi(port); + /* remove the port state file */ + + snprintf(path, PATH_MAX, VHCI_STATE_PATH"/port%d", portnum); + + remove(path); + rmdir(VHCI_STATE_PATH); + ret = usbip_vhci_driver_open(); if (ret < 0) { err("open vhci_driver");