]> git.baikalelectronics.ru Git - kernel.git/commit
net: bridge: Fix uninitialized error in br_fdb_sync_static()
authorGeert Uytterhoeven <geert@linux-m68k.org>
Thu, 1 Feb 2018 10:25:27 +0000 (11:25 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 1 Feb 2018 14:47:37 +0000 (09:47 -0500)
commitc668662e1b1fc84f58b14c0c6e05ceacca4346ea
tree1badccc18cf051afe8361c57b8e93ce787e49ab6
parente5d48be0ac2c4a1fbc9599b5cb919c7614033272
net: bridge: Fix uninitialized error in br_fdb_sync_static()

With gcc-4.1.2.:

    net/bridge/br_fdb.c: In function ‘br_fdb_sync_static’:
    net/bridge/br_fdb.c:996: warning: ‘err’ may be used uninitialized in this function

Indeed, if the list is empty, err will be uninitialized, and will be
propagated up as the function return value.

Fix this by preinitializing err to zero.

Fixes: d22e90a90b491037 ("net: bridge: use rhashtable for fdbs")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_fdb.c