On 04.03.2021 17:03:28, Marc Kleine-Budde wrote: > This patch uses the previously added mcp251xfd_skb_set_timestamp() > function to convert the timestamp done by the CAN controller into a > proper skb hw timestamp. > > Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> > --- > .../net/can/spi/mcp251xfd/mcp251xfd-core.c | 22 ++++++++++++++----- > 1 file changed, 17 insertions(+), 5 deletions(-) > > diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c > index 965f8d82b8a1..24b91a6f380b 100644 > --- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c > +++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c > @@ -1268,7 +1268,8 @@ mcp251xfd_handle_tefif_one(struct mcp251xfd_priv *priv, > unsigned int *frame_len_ptr) > { > struct net_device_stats *stats = &priv->ndev->stats; > - u32 seq, seq_masked, tef_tail_masked; > + struct sk_buff *skb; > + u32 seq, seq_masked, tef_tail_masked, tef_tail; > > seq = FIELD_GET(MCP251XFD_OBJ_FLAGS_SEQ_MCP2518FD_MASK, > hw_tef_obj->flags); > @@ -1284,9 +1285,12 @@ mcp251xfd_handle_tefif_one(struct mcp251xfd_priv *priv, > if (seq_masked != tef_tail_masked) > return mcp251xfd_handle_tefif_recover(priv, seq); > > + tef_tail = mcp251xfd_get_tef_tail(priv); > + skb = priv->can.echo_skb[tef_tail]; > + mcp251xfd_skb_set_timestamp(priv, skb, hw_tef_obj->ts); Doh! I've send an old patch. There's a NULL pointer check missing. skb can be NULL. regards, Marc -- Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Attachment:
signature.asc
Description: PGP signature