aboutsummaryrefslogtreecommitdiff
path: root/lib/mpi/mpi-sub-ui.c
diff options
context:
space:
mode:
authorAnssi Hannula <[email protected]>2022-10-10 20:52:27 +0200
committerMarc Kleine-Budde <[email protected]>2022-10-27 09:00:39 +0200
commit2871edb32f4622c3a25ce4b3977bad9050b91974 (patch)
tree8f51d60ca1407fb026e87c447fa2a488c6fe682a /lib/mpi/mpi-sub-ui.c
parente2badb4bd33abe13ddc35975bd7f7f8693955a4b (diff)
can: kvaser_usb: Fix possible completions during init_completion
kvaser_usb uses completions to signal when a response event is received for outgoing commands. However, it uses init_completion() to reinitialize the start_comp and stop_comp completions before sending the start/stop commands. In case the device sends the corresponding response just before the actual command is sent, complete() may be called concurrently with init_completion() which is not safe. This might be triggerable even with a properly functioning device by stopping the interface (CMD_STOP_CHIP) just after it goes bus-off (which also causes the driver to send CMD_STOP_CHIP when restart-ms is off), but that was not tested. Fix the issue by using reinit_completion() instead. Fixes: 080f40a6fa28 ("can: kvaser_usb: Add support for Kvaser CAN/USB devices") Tested-by: Jimmy Assarsson <[email protected]> Signed-off-by: Anssi Hannula <[email protected]> Signed-off-by: Jimmy Assarsson <[email protected]> Link: https://lore.kernel.org/all/[email protected] Cc: [email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
Diffstat (limited to 'lib/mpi/mpi-sub-ui.c')
0 files changed, 0 insertions, 0 deletions