Re: [bug report] net: dsa: allow masters to join a LAG

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 14, 2022 at 10:35:24AM +0000, Vladimir Oltean wrote:
> 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?

Yeah, I'll write a patch.  Thanks!

regards,
dan carpenter



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux