]> git.droids-corp.org - dpdk.git/blobdiff - lib/eal/windows/eal_alarm.c
mem: quiet base address hint warning if not requested
[dpdk.git] / lib / eal / windows / eal_alarm.c
index f5bf88715afd5dc646bd54a72c38a26fb974fb76..103c1f909da3e75a3d3cf42808772d3a226ee4f7 100644 (file)
@@ -4,6 +4,7 @@
 
 #include <stdatomic.h>
 #include <stdbool.h>
+#include <sys/queue.h>
 
 #include <rte_alarm.h>
 #include <rte_spinlock.h>
@@ -91,6 +92,12 @@ rte_eal_alarm_set(uint64_t us, rte_eal_alarm_callback cb_fn, void *cb_arg)
        LARGE_INTEGER deadline;
        int ret;
 
+       if (cb_fn == NULL) {
+               RTE_LOG(ERR, EAL, "NULL callback\n");
+               ret = -EINVAL;
+               goto exit;
+       }
+
        /* Calculate deadline ASAP, unit of measure = 100ns. */
        GetSystemTimePreciseAsFileTime(&ft);
        deadline.LowPart = ft.dwLowDateTime;
@@ -180,6 +187,12 @@ rte_eal_alarm_cancel(rte_eal_alarm_callback cb_fn, void *cb_arg)
        bool executing;
 
        removed = 0;
+
+       if (cb_fn == NULL) {
+               RTE_LOG(ERR, EAL, "NULL callback\n");
+               return -EINVAL;
+       }
+
        do {
                executing = false;