Skip to content

Commit ec501ae

Browse files
almusilkevintraynor
authored andcommitted
dpdk: Avoid maybe uninitialized for found_value variable.
The GCC with -O1 -fno-omit-frame-pointer -fno-common started to report the following warning: In function 'construct_dpdk_mutex_options', inlined from 'construct_dpdk_args' at lib/dpdk.c:238:5, inlined from 'dpdk_init__' at lib/dpdk.c:393:5, inlined from 'dpdk_init' at lib/dpdk.c:534:23: lib/dpdk.c:220:13: error: 'found_value' may be used uninitialized [-Werror=maybe-uninitialized] 220 | svec_add(args, found_value); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/dpdk.c: In function 'dpdk_init': lib/dpdk.c:189:21: note: 'found_value' was declared here 189 | const char *found_value; | ^~~~~~~~~~~ cc1: all warnings being treated as errors Assign NULL to the variable to avoid this warning. Signed-off-by: Ales Musil <[email protected]> Signed-off-by: Kevin Traynor <[email protected]>
1 parent fc31188 commit ec501ae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/dpdk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ construct_dpdk_mutex_options(const struct smap *ovs_other_config,
123123
int i;
124124
for (i = 0; i < ARRAY_SIZE(excl_opts); ++i) {
125125
int found_opts = 0, scan, found_pos = -1;
126-
const char *found_value;
126+
const char *found_value = NULL;
127127
struct dpdk_exclusive_options_map *popt = &excl_opts[i];
128128

129129
for (scan = 0; scan < MAX_DPDK_EXCL_OPTS

0 commit comments

Comments
 (0)