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>
This commit is contained in:
Tobias Klauser 2011-08-19 08:54:18 +02:00 committed by Greg Kroah-Hartman
parent 97c451ca10
commit 549fb10097
1 changed files with 3 additions and 1 deletions

View File

@ -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);