diff mbox series

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

Message ID 20211018172833.534191-10-hj.tedd.an@gmail.com (mailing list archive)
State Accepted
Delegated to: Luiz Von Dentz
Headers show
Series Fix unchecked return value | expand

Checks

Context Check Description
tedd_an/checkpatch success Checkpatch PASS
tedd_an/gitlint success Gitlint PASS

Commit Message

Tedd Ho-Jeong An Oct. 18, 2021, 5:28 p.m. UTC
From: Tedd Ho-Jeong An <tedd.an@intel.com>

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 mbox series

Patch

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,