diff options
author | Oliver Hartkopp <[email protected]> | 2023-06-07 09:27:08 +0200 |
---|---|---|
committer | Marc Kleine-Budde <[email protected]> | 2023-06-22 10:45:09 +0200 |
commit | e38910c0072b541a91954682c8b074a93e57c09b (patch) | |
tree | f05a5da6cdab0752206842f3374cbc2715ebe1b4 | |
parent | 7f4e09700bdc13ce9aafa279bc999051e9bcda35 (diff) |
can: isotp: isotp_sendmsg(): fix return error fix on TX path
With commit d674a8f123b4 ("can: isotp: isotp_sendmsg(): fix return
error on FC timeout on TX path") the missing correct return value in
the case of a protocol error was introduced.
But the way the error value has been read and sent to the user space
does not follow the common scheme to clear the error after reading
which is provided by the sock_error() function. This leads to an error
report at the following write() attempt although everything should be
working.
Fixes: d674a8f123b4 ("can: isotp: isotp_sendmsg(): fix return error on FC timeout on TX path")
Reported-by: Carsten Schmidt <[email protected]>
Signed-off-by: Oliver Hartkopp <[email protected]>
Link: https://lore.kernel.org/all/[email protected]
Cc: [email protected]
Signed-off-by: Marc Kleine-Budde <[email protected]>
-rw-r--r-- | net/can/isotp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/can/isotp.c b/net/can/isotp.c index 84f9aba02901..ca9d728d6d72 100644 --- a/net/can/isotp.c +++ b/net/can/isotp.c @@ -1112,8 +1112,9 @@ wait_free_buffer: if (err) goto err_event_drop; - if (sk->sk_err) - return -sk->sk_err; + err = sock_error(sk); + if (err) + return err; } return size; |