Skip to content
Commit 103108cb authored by Marc Kleine-Budde's avatar Marc Kleine-Budde
Browse files

can: gs_usb: gs_can_open(): initialize time counter before starting device

On busy networks the CAN controller might receive CAN frames directly
after starting it but before the timecounter is setup. This will lead
to NULL pointer deref while converting the converting the CAN frame's
timestamp with the timecounter.

Close the race window by setting up the timecounter before starting
the CAN controller.

Fixes: 45dfa45f ("can: gs_usb: add RX and TX hardware timestamp support")
Link: https://lore.kernel.org/all/20220921081329.385509-1-mkl@pengutronix.de


Cc: John Whittington <git@jbrengineering.co.uk
Tested-by: default avatarJohn Whittington <git@jbrengineering.co.uk>
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 29a8c9ec
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment