Coverity fixes. 99/153699/1
authorINSUN PYO <insun.pyo@samsung.com>
Fri, 29 Sep 2017 07:04:21 +0000 (16:04 +0900)
committerINSUN PYO <insun.pyo@samsung.com>
Fri, 29 Sep 2017 07:04:37 +0000 (16:04 +0900)
Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: If524dfd179eb01d40855e5e6570a488e759550c7

src/haptic/standard-mix.c
src/haptic/standard.c

index 40bda76..800bb10 100644 (file)
@@ -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;
                }
index 21bd343..2a914ca 100644 (file)
@@ -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;
                }