mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
UPSTREAM: can: isotp: isotp_sendmsg(): fix return error fix on TX path
commite38910c007upstream. With commitd674a8f123("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:d674a8f123("can: isotp: isotp_sendmsg(): fix return error on FC timeout on TX path") Reported-by: Carsten Schmidt <carsten.schmidt-achim@t-online.de> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net> Link: https://lore.kernel.org/all/20230607072708.38809-1-socketcan@hartkopp.net Cc: stable@vger.kernel.org Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Change-Id: I6cb85ee1e6fdc609991c383e4f6fc71ea3c68c3a (cherry picked from commite38910c007) Signed-off-by: Suren Baghdasaryan <surenb@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
committed by
Treehugger Robot
parent
5887040491
commit
af2d741bf3
@@ -1079,8 +1079,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;
|
||||
|
||||
Reference in New Issue
Block a user