diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-09-30 18:17:10 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-10-03 07:55:18 +0200 |
commit | ab580705693d5af79663efa504a72248700766fc (patch) | |
tree | ddb2b791a3a865f46a830101166bf8f8171d1b5a /net/openvswitch/flow.c | |
parent | net/mlx5e: shut up maybe-uninitialized warning (diff) | |
download | linux-ab580705693d5af79663efa504a72248700766fc.tar.xz linux-ab580705693d5af79663efa504a72248700766fc.zip |
mlxsw: spectrum_router: avoid potential uninitialized data usage
If fi->fib_nhs is zero, the router interface pointer is uninitialized, as shown by
this warning:
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c: In function 'mlxsw_sp_router_fib_event':
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:1674:21: error: 'r' may be used uninitialized in this function [-Werror=maybe-uninitialized]
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:1643:23: note: 'r' was declared here
This changes the loop so we handle the case the same way as finding no router
interface pointer attached to one of the nexthops to ensure we always
trap here instead of using uninitialized data.
Fixes: b45f64d16d45 ("mlxsw: spectrum_router: Use FIB notifications instead of switchdev calls")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/openvswitch/flow.c')
0 files changed, 0 insertions, 0 deletions