The trace framework can be configured via 4 EAL options:
- --trace which calls eal_trace_args_save,
- --trace-dir which calls eal_trace_dir_args_save,
- --trace-bufsz which calls eal_trace_bufsz_args_save,
- --trace-mode which calls eal_trace_mode_args_save.
Those 4 internal callbacks are getting passed a non NULL value:
optarg won't be NULL since those options are declared with
required_argument (man getopt_long).
eal_trace_bufsz_args_save() already trusted passed value, align the other
3 internal callbacks.
Coverity issue: 357768
Fixes: 8c8066ea6a7b ("trace: add trace mode configuration parameter")
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Sunil Kumar Kori <skori@marvell.com>
        struct trace *trace = trace_obj_get();
        uint64_t bufsz;
 
-       if (val == NULL) {
-               trace_err("no optarg is passed");
-               return -EINVAL;
-       }
-
        bufsz = rte_str_to_size(val);
        if (bufsz == 0) {
                trace_err("buffer size cannot be zero");
        unsigned long tmp;
        char *pattern;
 
-       if (val == NULL) {
-               trace_err("no optarg is passed");
-               return -EINVAL;
-       }
-
        if (len == 0) {
                trace_err("value is not provided with option");
                return -EINVAL;
        char *dir_path = NULL;
        int rc;
 
-       if (val == NULL) {
-               trace_err("no optarg is passed");
-               return -EINVAL;
-       }
-
        if (strlen(val) >= size) {
                trace_err("input string is too big");
                return -ENAMETOOLONG;