Checks
Context | Check | Description |
---|---|---|
ci/checkpatch | success | coding style OK |
Commit Message
fengchengwen
March 20, 2023, 9:21 a.m. UTC
The rte_kvargs_process() was used to parse KV pairs, it also supports
to parse 'only keys' (e.g. socket_id) type. And the callback function
parameter 'value' is NULL when parsed 'only keys'.
This patch fixes segment fault when parse input args with 'only keys'.
Fixes: 3516327e00fd ("event/octeontx: add selftest to device arguments")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
drivers/event/octeontx/ssovf_evdev.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c index 650266b996..b9b5fa8668 100644 --- a/drivers/event/octeontx/ssovf_evdev.c +++ b/drivers/event/octeontx/ssovf_evdev.c @@ -717,6 +717,8 @@ static int ssovf_parsekv(const char *key __rte_unused, const char *value, void *opaque) { int *flag = opaque; + if (value == NULL) + return -EINVAL; *flag = !!atoi(value); return 0; }