[bug report] rxrpc: Make the I/O thread take over the call and local processor work

Dan Carpenter error27 at gmail.com
Wed Dec 7 06:15:41 PST 2022


Hello David Howells,

The patch 5e6ef4f1017c: "rxrpc: Make the I/O thread take over the
call and local processor work" from Jan 23, 2020, leads to the
following Smatch static checker warning:

	net/rxrpc/io_thread.c:283 rxrpc_input_packet()
	warn: bool is not less than zero.

net/rxrpc/io_thread.c
    275                 return ret;
    276         }
    277 
    278         peer = rxrpc_get_peer_maybe(peer, rxrpc_peer_get_input);
    279         rcu_read_unlock();
    280 
    281         ret = rxrpc_new_incoming_call(local, peer, NULL, &peer_srx, skb);
    282         rxrpc_put_peer(peer, rxrpc_peer_put_input);
--> 283         if (ret < 0)

The rxrpc_new_incoming_call() function returns bool so it can't be zero.

It's a puzzle why this warning is only showing now when the code is two
years old...

    284                 goto reject_packet;
    285         return 0;
    286 
    287 bad_message:
    288         trace_rxrpc_abort(0, "BAD", sp->hdr.cid, sp->hdr.callNumber, sp->hdr.seq,
    289                           RX_PROTOCOL_ERROR, EBADMSG);
    290 protocol_error:
    291         skb->priority = RX_PROTOCOL_ERROR;
    292         skb->mark = RXRPC_SKB_MARK_REJECT_ABORT;
    293 reject_packet:
    294         rxrpc_reject_packet(local, skb);
    295         return ret;
    296 }

regards,
dan carpenter



More information about the linux-afs mailing list