re: bonding: remove entries for master_ip and vlan_ip and query devices instead

From: Dan Carpenter <hidden>
Date: 2012-10-25 12:29:16

[ Sort of old, but apparently I didn't email about this in March ].

Hello Andy Gospodarek,

This is a semi-automatic email about new static checker warnings.

The patch eaddcd76903c: "bonding: remove entries for master_ip and 
vlan_ip and query devices instead" from Mar 22, 2012, leads to the 
following Smatch complaint:

drivers/net/bonding/bond_main.c:2703 bond_arp_send_all()
	 warn: variable dereferenced before check 'vlan_dev' (see line 2697)

drivers/net/bonding/bond_main.c
  2696					vlan_id = vlan->vlan_id;
                                        ^^^^^^^^^^
If vlan_id is non-zero it means we went hit this assignment.

  2697					pr_debug("basa: vlan match on %s %d\n",
  2698					       vlan_dev->name, vlan_id);
                                               ^^^^^^^^^^
Old dereference.

  2699					break;
  2700				}
  2701			}
  2702	
  2703			if (vlan_id && vlan_dev) {
                                       ^^^^^^^^
New check.

  2704				ip_rt_put(rt);
  2705				addr = bond_confirm_addr(vlan_dev, targets[i], 0);

regards,
dan carpenter
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help