drivers: can: mcan: fix off-by-one error in assert

Fix off-by-one error in assert

Signed-off-by: Grant Ramsay <gramsay@enphaseenergy.com>
This commit is contained in:
Grant Ramsay 2023-08-03 13:56:13 +12:00 committed by Fabio Baltieri
commit cff1496166

View file

@ -924,7 +924,7 @@ int can_mcan_send(const struct device *dev, const struct can_frame *frame, k_tim
goto err_unlock; goto err_unlock;
} }
__ASSERT_NO_MSG(put_idx <= cbs->num_tx); __ASSERT_NO_MSG(put_idx < cbs->num_tx);
cbs->tx[put_idx].function = callback; cbs->tx[put_idx].function = callback;
cbs->tx[put_idx].user_data = user_data; cbs->tx[put_idx].user_data = user_data;