net/tap: fix icc build
authorZhiyong Yang <zhiyong.yang@intel.com>
Thu, 1 Feb 2018 04:43:00 +0000 (12:43 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 1 Feb 2018 09:31:18 +0000 (10:31 +0100)
The following error is reported when compiling 18.02-rc2 using ICC,
"transfer of control bypasses initialization of".
The patch fixes the issue.

Fixes: 1911c5edc6cd ("net/tap: fix eBPF RSS map key handling")

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
drivers/net/tap/tap_flow.c

index 212992e..65657f0 100644 (file)
@@ -1930,6 +1930,7 @@ static int bpf_rss_key(enum bpf_rss_key_e cmd, __u32 *key_idx)
        static __u32 num_used_keys;
        static __u32 rss_keys[MAX_RSS_KEYS] = {KEY_STAT_UNSPEC};
        static __u32 rss_keys_initialized;
+       __u32 key;
 
        switch (cmd) {
        case KEY_CMD_GET:
@@ -1975,7 +1976,7 @@ static int bpf_rss_key(enum bpf_rss_key_e cmd, __u32 *key_idx)
                 * map index as an out-of-range value and the release operation
                 * will be silently ignored.
                 */
-               __u32 key = *key_idx - KEY_IDX_OFFSET;
+               key = *key_idx - KEY_IDX_OFFSET;
                if (key >= RTE_DIM(rss_keys))
                        break;