Thread (11 messages) 11 messages, 2 authors, 2021-10-18

[BlueZ PATCH 9/9] peripheral: Fix unchecked return value

flat view
STALE1816d

From: Tedd Ho-Jeong An <hidden>
Date: 2021-10-18 17:28:50
Subsystem: the rest · Maintainer: Linus Torvalds

From: Tedd Ho-Jeong An <redacted>

This patch fixes the unchecked return value(CWE-252) issues reported by
the Coverity.
---
 peripheral/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/peripheral/main.c b/peripheral/main.c
index 6ce729178..86b52236e 100644
--- a/peripheral/main.c
+++ b/peripheral/main.c
@@ -77,7 +77,8 @@ static void prepare_filesystem(void)
 
 		if (lstat(mount_table[i].target, &st) < 0) {
 			printf("Creating %s\n", mount_table[i].target);
-			mkdir(mount_table[i].target, 0755);
+			if (mkdir(mount_table[i].target, 0755) < 0)
+				perror("Failed to create dir");
 		}
 
 		printf("Mounting %s to %s\n", mount_table[i].fstype,
-- 
2.25.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help