Fix return value, using -EAGAIN instead of 0 when the callback is busy
and using -ENOENT instead of 0 when the callback is not found.
Fixes: a753e53d517b ("eal: add device event monitor framework")
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>
                        free(event_cb);
                        ret++;
                } else {
-                       continue;
+                       ret = -EAGAIN;
+                       break;
                }
        }
+
+       /* this callback is not be registered */
+       if (ret == 0)
+               ret = -ENOENT;
+
        rte_spinlock_unlock(&dev_event_lock);
        return ret;
 }