Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
can: isotp: isotp_sendmsg(): fix return error on FC timeout on TX path
BugLink: https://bugs.launchpad.net/bugs/1952136 commit d674a8f upstream. When the a large chunk of data send and the receiver does not send a Flow Control frame back in time, the sendmsg() does not return a error code, but the number of bytes sent corresponding to the size of the packet. If a timeout occurs the isotp_tx_timer_handler() is fired, sets sk->sk_err and calls the sk->sk_error_report() function. It was wrongly expected that the error would be propagated to user space in every case. For isotp_sendmsg() blocking on wait_event_interruptible() this is not the case. This patch fixes the problem by checking if sk->sk_err is set and returning the error to user space. Fixes: e057dd3 ("can: add ISO 15765-2:2016 transport protocol") Link: hartkopp/can-isotp#42 Link: hartkopp/can-isotp#43 Link: https://lore.kernel.org/all/[email protected] Cc: [email protected] Reported-by: Sottas Guillaume (LMB) <[email protected]> Tested-by: Oliver Hartkopp <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Kamal Mostafa <[email protected]> Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
- Loading branch information