[Fix/Triv2] Fix checking a file descriptor of npu_sched driver
authorDongju Chae <dongju.chae@samsung.com>
Thu, 20 May 2021 04:58:59 +0000 (13:58 +0900)
committer문지중/On-Device Lab(SR)/Principal Engineer/삼성전자 <jijoong.moon@samsung.com>
Tue, 25 May 2021 03:38:51 +0000 (12:38 +0900)
This patch fixes checking a file descriptor of npu_sched driver.
A file descriptor returned by `::open` can have even zero.

Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
src/core/npu/NPUdrvAPI_triv2.cc

index b7fb8a1..4331186 100644 (file)
@@ -466,7 +466,7 @@ TrinityVision2API::runInput (input_config_t *input_config) const {
   if (input_config == nullptr)
     return -EINVAL;
 
-  if (sched_dev_fd_ > 0) {
+  if (sched_dev_fd_ >= 0) {
     struct npu_sched_create_task val;
     struct npu_sched_activate_task val2;
     uint32_t subtask_id;