mirror of
https://github.com/apache/nuttx.git
synced 2025-05-08 22:32:04 +08:00

In a recent patch the socketcan timestamp generation was moved to add it also when there is an active reader (previously the timestamp was only added before storing the CAN frame in the read-ahead list). It was working fine but I realized that the can_callback function is also called when sending frames. In this case, the IO block is not allocated yet and the code breaks. This PR is to only generate the timestamp if the IO block is not NULL (reading path) and skip it when it is NULL (sending path) Signed-off-by: Javier Casas <javiercasas@geotab.com>