From: Tobias Klauser Date: Fri, 19 Aug 2011 06:54:18 +0000 (+0200) Subject: staging: usbip: userspace: Check return value for mkdir() X-Git-Tag: MMI-PSA29.97-13-9~18234^2^2~864^2~177 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=549fb1009755a6ca3cef30914b8c3529ca711947;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git staging: usbip: userspace: Check return value for mkdir() mkdir() could fail, so we should check its return value. Signed-off-by: Tobias Klauser Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/usbip/userspace/src/usbip_attach.c b/drivers/staging/usbip/userspace/src/usbip_attach.c index b7885a202757..bdf61c0fe699 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);