Messages in this thread | | | Date | Wed, 26 Oct 2022 23:13:51 +0300 | From | Vladimir Oltean <> | Subject | Re: [RFC Patch net-next 5/6] net: dsa: microchip: Adding the ptp packet reception logic |
| |
On Tue, Oct 25, 2022 at 08:17:37AM +0200, Christian Eggers wrote: > > +static int ksz_connect_tag_protocol(struct dsa_switch *ds, > > + enum dsa_tag_protocol proto) > > +{ > > + struct ksz_tagger_data *tagger_data; > > + > > + tagger_data = ksz_tagger_data(ds); > > NULL pointer dereference is here: > > ksz_connect() is only called for "lan937x", not for the other KSZ switches. > If ksz_connect() shall only be called for PTP switches, the result of > ksz_tagger_data() may be NULL. > > > + tagger_data->meta_tstamp_handler = ksz_tstamp_reconstruct; > > + > > + return 0; > > +} > > +
The observation is correct. All other drivers which use this API check the protocol given as argument, and for good reason. Only "lan937x" allocates tagger-owned storage in Arun's implementation, but the common ksz library supports more tagging protocols.
| |