EAL functions rte_eal_alarm_set() and rte_eal_alarm_cancel()
did not for invalid parameters in Windows implementation,
which is caught by the unit test alarm_autotest.
Enforce parameter check to fail fast for invalid parameters.
Fixes:
f4cbdbc7fbd2 ("eal/windows: implement alarm API")
Cc: stable@dpdk.org
Signed-off-by: Jie Zhou <jizh@linux.microsoft.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
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;
bool executing;
removed = 0;
+
+ if (cb_fn == NULL) {
+ RTE_LOG(ERR, EAL, "NULL callback\n");
+ return -EINVAL;
+ }
+
do {
executing = false;