diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2011-08-19 08:54:18 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-08-23 14:42:33 -0700 |
commit | 549fb1009755a6ca3cef30914b8c3529ca711947 (patch) | |
tree | f80a4599ff5b84d1593a6d5da80f0072dfb5750e /drivers/staging/usbip | |
parent | 97c451ca1094d9d1ed1f3bf7c7a8b65b783e37e0 (diff) | |
download | op-kernel-dev-549fb1009755a6ca3cef30914b8c3529ca711947.zip op-kernel-dev-549fb1009755a6ca3cef30914b8c3529ca711947.tar.gz |
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.c | 4 |
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 b7885a2..bdf61c0 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); |