Skip to content

Commit 01644a1

Browse files
dhowellskuba-moo
authored andcommitted
rxrpc: Fix wrong error return in rxrpc_connect_call()
Fix rxrpc_connect_call() to return -ENOMEM rather than 0 if it fails to look up a peer. This generated a smatch warning: net/rxrpc/call_object.c:303 rxrpc_connect_call() warn: missing error code 'ret' I think this also fixes a syzbot-found bug: rxrpc: Assertion failed - 1(0x1) == 11(0xb) is false ------------[ cut here ]------------ kernel BUG at net/rxrpc/call_object.c:645! where the call being put is in the wrong state - as would be the case if we failed to clear up correctly after the error in rxrpc_connect_call(). Fixes: 9d35d88 ("rxrpc: Move client call connection to the I/O thread") Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Reported-and-tested-by: [email protected] Signed-off-by: David Howells <[email protected]> Link: https://lore.kernel.org/r/[email protected]/ Reviewed-by: Alexander Duyck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 80c8252 commit 01644a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/rxrpc/call_object.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ static void rxrpc_put_call_slot(struct rxrpc_call *call)
294294
static int rxrpc_connect_call(struct rxrpc_call *call, gfp_t gfp)
295295
{
296296
struct rxrpc_local *local = call->local;
297-
int ret = 0;
297+
int ret = -ENOMEM;
298298

299299
_enter("{%d,%lx},", call->debug_id, call->user_call_ID);
300300

0 commit comments

Comments
 (0)