Hello Dan Carpenter, On Fri, Oct 14, 2022 at 12:41:05PM +0300, Dan Carpenter wrote: > Hello Vladimir Oltean, > > The patch acc43b7bf52a: "net: dsa: allow masters to join a LAG" from > Sep 11, 2022, leads to the following Smatch static checker warning: > > net/dsa/slave.c:3165 dsa_slave_netdevice_event() > error: uninitialized symbol 'err'. > > net/dsa/slave.c > 3145 case NETDEV_CHANGELOWERSTATE: { > 3146 struct netdev_notifier_changelowerstate_info *info = ptr; > 3147 struct dsa_port *dp; > 3148 int err; > 3149 > 3150 if (dsa_slave_dev_check(dev)) { > 3151 dp = dsa_slave_to_port(dev); > 3152 > 3153 err = dsa_port_lag_change(dp, info->lower_state_info); > 3154 } > 3155 > 3156 /* Mirror LAG port events on DSA masters that are in > 3157 * a LAG towards their respective switch CPU ports > 3158 */ > 3159 if (netdev_uses_dsa(dev)) { > 3160 dp = dev->dsa_ptr; > 3161 > 3162 err = dsa_port_lag_change(dp, info->lower_state_info); > 3163 } > > Can both dsa_slave_dev_check() and netdev_uses_dsa() be false? Thanks for the report. Yes, it can happen that the logic falls through neither of those conditions. "err" needs to be initialized with 0 in that case. Could you please prepare a patch?