From 549fb1009755a6ca3cef30914b8c3529ca711947 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 19 Aug 2011 08:54:18 +0200 Subject: [PATCH] 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 --- drivers/staging/usbip/userspace/src/usbip_attach.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 2.20.1