summaryrefslogtreecommitdiff
path: root/drivers/staging/usbip
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2011-08-19 08:54:18 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2011-08-23 14:42:33 -0700
commit549fb1009755a6ca3cef30914b8c3529ca711947 (patch)
treef80a4599ff5b84d1593a6d5da80f0072dfb5750e /drivers/staging/usbip
parent97c451ca1094d9d1ed1f3bf7c7a8b65b783e37e0 (diff)
staging: usbip: userspace: Check return value for mkdir()
mkdir() could fail, so we should check its return value. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/usbip')
-rw-r--r--drivers/staging/usbip/userspace/src/usbip_attach.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/usbip/userspace/src/usbip_attach.c b/drivers/staging/usbip/userspace/src/usbip_attach.c
index b7885a20275..bdf61c0fe69 100644
--- a/drivers/staging/usbip/userspace/src/usbip_attach.c
+++ b/drivers/staging/usbip/userspace/src/usbip_attach.c
@@ -51,7 +51,9 @@ static int record_connection(char *host, char *port, char *busid, int rhport)
char buff[MAX_BUFF+1];
int ret;
- mkdir(VHCI_STATE_PATH, 0700);
+ ret = mkdir(VHCI_STATE_PATH, 0700);
+ if (ret < 0)
+ return -1;
snprintf(path, PATH_MAX, VHCI_STATE_PATH"/port%d", rhport);