summaryrefslogtreecommitdiff
path: root/net/bridge/br_netlink.c
diff options
context:
space:
mode:
authorRoopa Prabhu <roopa@cumulusnetworks.com>2015-01-12 16:25:28 -0800
committerDavid S. Miller <davem@davemloft.net>2015-01-13 16:39:36 -0500
commit0fe6de490320bfbf1b82a33d7ee49b62af5f29db (patch)
treecd24a37b07737ed73f637c6856f0351891cc570c /net/bridge/br_netlink.c
parentc66ad9ca3f4f55886829a61bd24fc5612d0c05c1 (diff)
bridge: fix uninitialized variable warning
net/bridge/br_netlink.c: In function ‘br_fill_ifinfo’: net/bridge/br_netlink.c:146:32: warning: ‘vid_range_flags’ may be used uninitialized in this function [-Wmaybe-uninitialized] err = br_fill_ifvlaninfo_range(skb, vid_range_start, ^ net/bridge/br_netlink.c:108:6: note: ‘vid_range_flags’ was declared here u16 vid_range_flags; Reported-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_netlink.c')
-rw-r--r--net/bridge/br_netlink.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 0b03879488c4..66ece91ee165 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -105,7 +105,7 @@ static int br_fill_ifvlaninfo_compressed(struct sk_buff *skb,
const struct net_port_vlans *pv)
{
u16 vid_range_start = 0, vid_range_end = 0;
- u16 vid_range_flags;
+ u16 vid_range_flags = 0;
u16 pvid, vid, flags;
int err = 0;
@@ -142,12 +142,14 @@ initvars:
vid_range_flags = flags;
}
- /* Call it once more to send any left over vlans */
- err = br_fill_ifvlaninfo_range(skb, vid_range_start,
- vid_range_end,
- vid_range_flags);
- if (err)
- return err;
+ if (vid_range_start != 0) {
+ /* Call it once more to send any left over vlans */
+ err = br_fill_ifvlaninfo_range(skb, vid_range_start,
+ vid_range_end,
+ vid_range_flags);
+ if (err)
+ return err;
+ }
return 0;
}