[bug report] net: dsa: Remove master_netdev and use dst->cpu_dp->netdev

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

 



Hello Florian Fainelli,

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

The patch 6d3c8c0dd88a: "net: dsa: Remove master_netdev and use 
dst->cpu_dp->netdev" from Jun 13, 2017, leads to the following Smatch 
complaint:

net/dsa/dsa2.c:447 dsa_dst_apply()
	 error: we previously assumed 'dst->cpu_dp' could be null (see line 436)

net/dsa/dsa2.c
   435	
   436		if (dst->cpu_dp) {
                    ^^^^^^^^^^^
The existing code assumes this can be NULL.

   437			err = dsa_cpu_port_ethtool_setup(dst->cpu_dp);
   438			if (err)
   439				return err;
   440		}
   441	
   442		/* If we use a tagging format that doesn't have an ethertype
   443		 * field, make sure that all packets from this point on get
   444		 * sent to the tag format's receive function.
   445		 */
   446		wmb();
   447		dst->cpu_dp->netdev->dsa_ptr = dst;
                ^^^^^^^^^^^^^
The patch derefrences it without checking.

   448		dst->applied = true;
   449	

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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