diff options
author | David Howells <dhowells@redhat.com> | 2019-07-02 16:55:28 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-07-02 21:09:09 +0200 |
commit | 3427beb6375d04e9627c67343872e79341a684ea (patch) | |
tree | 5b888c946a652af7f2100013bc33fa90cf20eac5 /net/rxrpc | |
parent | nfc: st-nci: remove redundant assignment to variable r (diff) | |
download | linux-3427beb6375d04e9627c67343872e79341a684ea.tar.xz linux-3427beb6375d04e9627c67343872e79341a684ea.zip |
rxrpc: Fix uninitialized error code in rxrpc_send_data_packet()
With gcc 4.1:
net/rxrpc/output.c: In function ‘rxrpc_send_data_packet’:
net/rxrpc/output.c:338: warning: ‘ret’ may be used uninitialized in this function
Indeed, if the first jump to the send_fragmentable label is made, and
the address family is not handled in the switch() statement, ret will be
used uninitialized.
Fix this by BUG()'ing as is done in other places in rxrpc where internal
support for future address families will need adding. It should not be
possible to reach this normally as the address families are checked
up-front.
Fixes: 5a924b8951f835b5 ("rxrpc: Don't store the rxrpc header in the Tx queue sk_buffs")
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rxrpc')
-rw-r--r-- | net/rxrpc/output.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/rxrpc/output.c b/net/rxrpc/output.c index a0b6abfbd277..948e3fe249ec 100644 --- a/net/rxrpc/output.c +++ b/net/rxrpc/output.c @@ -519,6 +519,9 @@ send_fragmentable: } break; #endif + + default: + BUG(); } if (ret < 0) |