Skip to content

Commit

Permalink
staging: usbip: userspace: Check return value for mkdir()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tobias Klauser authored and Greg Kroah-Hartman committed Aug 23, 2011
1 parent 97c451c commit 549fb10
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/staging/usbip/userspace/src/usbip_attach.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 549fb10

Please sign in to comment.