Fail to create timer pool with zero timer resolution.
https://bugs.linaro.org/show_bug.cgi?id=1451

Signed-off-by: Ola Liljedahl <[email protected]>
---
(This document/code contribution attached is provided under the terms of
agreement LES-LTM-21309)

 platform/linux-generic/odp_timer.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/platform/linux-generic/odp_timer.c 
b/platform/linux-generic/odp_timer.c
index 500f7f1..e5391dc 100644
--- a/platform/linux-generic/odp_timer.c
+++ b/platform/linux-generic/odp_timer.c
@@ -691,6 +691,11 @@ odp_timer_pool_create(const char *name,
                      const odp_timer_pool_param_t *param)
 {
        /* Verify that buffer pool can be used for timeouts */
+       /* Verify that we have a valid (non-zero) timer resolution */
+       if (param->res_ns == 0) {
+               __odp_errno = EINVAL;
+               return NULL;
+       }
        odp_timer_pool_t tp = odp_timer_pool_new(name, param);
        return tp;
 }
-- 
1.9.1

_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to