summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2021-10-19 13:14:36 +0100
committerDavid S. Miller <davem@davemloft.net>2021-10-19 13:14:36 +0100
commit04ee2752a5a9a715ad6dd56cc3eee3ec0bd846b4 (patch)
treeda39116815a8db9c73dfe43bfa014e1a8414dca1
parentc69b2f46876825c726bd8a97c7fa852d8932bc32 (diff)
parentd674a8f123b4096d85955c7eaabec688f29724c9 (diff)
Merge tag 'linux-can-fixes-for-5.15-20211019' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can
Marc Kleine-Budde says: ==================== pull-request: can 2021-10-19 this is a pull request of a single patch for net/master. The patch is by me and fixes the error handling in case of a FC timeout in the TX path of the ISOTOP CAN protocol. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/can/isotp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/can/isotp.c b/net/can/isotp.c
index d1f54273c0bb..df6968b28bf4 100644
--- a/net/can/isotp.c
+++ b/net/can/isotp.c
@@ -971,6 +971,9 @@ static int isotp_sendmsg(struct socket *sock, struct msghdr *msg, size_t size)
if (wait_tx_done) {
/* wait for complete transmission of current pdu */
wait_event_interruptible(so->wait, so->tx.state == ISOTP_IDLE);
+
+ if (sk->sk_err)
+ return -sk->sk_err;
}
return size;