drivers: can: mcux: flexcan: add missing mutex unlock in error path

Add missing mutex unlock to error handling path in
mcux_flexcan_add_rx_filter().

Fixes: #56284

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
Henrik Brix Andersen 2023-03-28 13:56:44 +02:00 committed by Fabio Baltieri
commit 4ec054aa45

View file

@ -515,7 +515,7 @@ static int mcux_flexcan_add_rx_filter(const struct device *dev,
}
if (alloc == -ENOSPC) {
return alloc;
goto unlock;
}
mcux_flexcan_can_filter_to_mbconfig(filter, &data->rx_cbs[alloc].mb_config,
@ -544,6 +544,7 @@ static int mcux_flexcan_add_rx_filter(const struct device *dev,
alloc = -ENOSPC;
}
unlock:
k_mutex_unlock(&data->rx_mutex);
return alloc;