mirror of https://gitee.com/openkylin/linux.git
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:
parent
97c451ca10
commit
549fb10097
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue