bridge: simplify br_getlink() a bit
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 21 Jan 2015 09:22:35 +0000 (12:22 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 26 Jan 2015 07:32:49 +0000 (23:32 -0800)
commit1b846f9282c0781f8ecf90e355008d94a0b973dd
treeafdeb123e3803cc84613ca895a8a386b7e44ec16
parent5c66cfe0780d02af6c1c64fdb655a85921855bee
bridge: simplify br_getlink() a bit

Static checkers complain that we should maybe set "ret" before we do the
"goto out;".  They interpret the NULL return from br_port_get_rtnl() as
a failure and forgetting to set the error code is a common bug in this
situation.

The code is confusing but it's actually correct.  We are returning zero
deliberately.  Let's re-write it a bit to be more clear.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_netlink.c