]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
rxrpc: Fix rxrpc_bundle::alloc_error to be signed
authorDavid Howells <dhowells@redhat.com>
Mon, 14 Sep 2020 12:10:00 +0000 (13:10 +0100)
committerDavid Howells <dhowells@redhat.com>
Mon, 14 Sep 2020 15:18:59 +0000 (16:18 +0100)
The alloc_error field in the rxrpc_bundle struct should be signed as it has
negative error codes assigned to it.  Checks directly on it may then fail,
and may produce a warning like this:

net/rxrpc/conn_client.c:662 rxrpc_wait_for_channel()
warn: 'bundle->alloc_error' is unsigned

Fixes: 245500d853e9 ("rxrpc: Rewrite the client connection manager")
Reported-by Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David Howells <dhowells@redhat.com>
net/rxrpc/ar-internal.h

index cd5a80b34738232306d2830fea3a3be23c24a6d3..19f714386654889be3734cf93b4b2e4d7115b72a 100644 (file)
@@ -395,7 +395,7 @@ struct rxrpc_bundle {
        unsigned int            debug_id;
        bool                    try_upgrade;    /* True if the bundle is attempting upgrade */
        bool                    alloc_conn;     /* True if someone's getting a conn */
-       unsigned short          alloc_error;    /* Error from last conn allocation */
+       short                   alloc_error;    /* Error from last conn allocation */
        spinlock_t              channel_lock;
        struct rb_node          local_node;     /* Node in local->client_conns */
        struct list_head        waiting_calls;  /* Calls waiting for channels */