Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 56bb7fd9 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by David S. Miller
Browse files

bridge: mdb: avoid uninitialized variable warning



A recent change to the mdb code confused the compiler to the point
where it did not realize that the port-group returned from
br_mdb_add_group() is always valid when the function returns a nonzero
return value, so we get a spurious warning:

net/bridge/br_mdb.c: In function 'br_mdb_add':
net/bridge/br_mdb.c:542:4: error: 'pg' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    __br_mdb_notify(dev, entry, RTM_NEWMDB, pg);

Slightly rearranging the code in br_mdb_add_group() makes the problem
go away, as gcc is clever enough to see that both functions check
for 'ret != 0'.

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Fixes: 9e8430f8 ("bridge: mdb: Passing the port-group pointer to br_mdb module")
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b5e4d0bc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment