]> git.baikalelectronics.ru Git - kernel.git/commit
rxrpc: Fix uninitialized error code in rxrpc_send_data_packet()
authorDavid Howells <dhowells@redhat.com>
Tue, 2 Jul 2019 14:55:28 +0000 (15:55 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 2 Jul 2019 19:09:09 +0000 (12:09 -0700)
commita9efff2415174b47acfa203427e7edb08b207b6d
tree5b888c946a652af7f2100013bc33fa90cf20eac5
parent7784746885ec9a2f85445eab42741dc094f0f942
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: 890847bc871f3b90 ("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>
net/rxrpc/output.c