From 39af87ca3f3eaf5750c58bb31f4b0af840f4a909 Mon Sep 17 00:00:00 2001 From: INSUN PYO Date: Fri, 29 Sep 2017 16:04:21 +0900 Subject: [PATCH] Coverity fixes. Signed-off-by: INSUN PYO Change-Id: If524dfd179eb01d40855e5e6570a488e759550c7 --- src/haptic/standard-mix.c | 4 ++-- src/haptic/standard.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/haptic/standard-mix.c b/src/haptic/standard-mix.c index 40bda76..800bb10 100644 --- a/src/haptic/standard-mix.c +++ b/src/haptic/standard-mix.c @@ -149,7 +149,7 @@ static bool check_fd(int *fd) return true; ffd = open(ff_path, O_RDWR); - if (ffd <= 0) + if (ffd < 0) return false; *fd = ffd; @@ -358,7 +358,7 @@ static int open_device(int device_index, int *device_handle) _I("First element: open ff driver"); /* open ff driver */ ff_fd = open(ff_path, O_RDWR); - if (!ff_fd) { + if (ff_fd < 0) { _E("Failed to open %s : %d", ff_path, errno); return -errno; } diff --git a/src/haptic/standard.c b/src/haptic/standard.c index 21bd343..2a914ca 100644 --- a/src/haptic/standard.c +++ b/src/haptic/standard.c @@ -111,7 +111,7 @@ static bool check_fd(int *fd) return true; ffd = open(ff_path, O_RDWR); - if (ffd <= 0) + if (ffd < 0) return false; *fd = ffd; @@ -320,7 +320,7 @@ static int open_device(int device_index, int *device_handle) _I("First element: open ff driver"); /* open ff driver */ ff_fd = open(ff_path, O_RDWR); - if (!ff_fd) { + if (ff_fd < 0) { _E("Failed to open %s : %d", ff_path, errno); return -errno; } -- 2.7.4