]> git.baikalelectronics.ru Git - kernel.git/commit
net: mpls: Fix GCC 12 warning
authorVictor Erminpour <victor.erminpour@oracle.com>
Thu, 10 Feb 2022 00:28:38 +0000 (16:28 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Feb 2022 15:29:39 +0000 (15:29 +0000)
commite1835b41e5ba0ca546b2b35b8112d8faeabbcda1
tree39018d7e473509138778d0391f2de9bf0890eda9
parent9f63e2f9053f98db8d06ded69a3579fd30bcb086
net: mpls: Fix GCC 12 warning

When building with automatic stack variable initialization, GCC 12
complains about variables defined outside of switch case statements.
Move the variable outside the switch, which silences the warning:

./net/mpls/af_mpls.c:1624:21: error: statement will never be executed [-Werror=switch-unreachable]
  1624 |                 int err;
       |                     ^~~

Signed-off-by: Victor Erminpour <victor.erminpour@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mpls/af_mpls.c