Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1494708

Re: [PATCH 2/2] mlxsw: spectrum_router: avoid potential uninitialized data usage

From David Miller <davem@davemloft.net>
Newsgroups linux.kernel
Subject Re: [PATCH 2/2] mlxsw: spectrum_router: avoid potential uninitialized data usage
Date 2016-10-03 08:00 +0200
Message-ID <so4sa-8tW-9@gated-at.bofh.it> (permalink)
References <sn8Hv-4bK-3@gated-at.bofh.it> <sn8Hv-4bK-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Arnd Bergmann <arnd@arndb.de>
Date: Fri, 30 Sep 2016 18:17:10 +0200

> 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>

Applied.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 2/2] mlxsw: spectrum_router: avoid potential uninitialized data usage Arnd Bergmann <arnd@arndb.de> - 2016-09-30 18:20 +0200
  Re: [PATCH 2/2] mlxsw: spectrum_router: avoid potential  uninitialized data usage Ido Schimmel <idosch@idosch.org> - 2016-09-30 20:10 +0200
    Re: [PATCH 2/2] mlxsw: spectrum_router: avoid potential uninitialized data usage Arnd Bergmann <arnd@arndb.de> - 2016-10-01 05:50 +0200
  Re: [PATCH 2/2] mlxsw: spectrum_router: avoid potential  uninitialized data usage David Miller <davem@davemloft.net> - 2016-10-03 08:00 +0200

csiph-web