* [PATCH] rxrpc: remove duplicate 'error' variable @ 2016-09-06 13:25 Arnd Bergmann 2016-09-06 13:34 ` David Howells 0 siblings, 1 reply; 3+ messages in thread From: Arnd Bergmann @ 2016-09-06 13:25 UTC (permalink / raw) To: David S. Miller, David Howells; +Cc: Arnd Bergmann, netdev, linux-kernel The rxrpc_process_call function has debug code to print a failure code, but instead of printing the code from the rxrpc_call structure, it prints an uninitialized variable: net/rxrpc/call_event.c: In function 'rxrpc_process_call': net/rxrpc/call_event.c:879:58: error: 'error' may be used uninitialized in this function [-Werror=maybe-uninitialized] This removes the extraneous variable and prints the correct code instead. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: f5c17aaeb2ae ("rxrpc: Calls should only have one terminal state") --- net/rxrpc/call_event.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/net/rxrpc/call_event.c b/net/rxrpc/call_event.c index de72de662044..4754c7fb6242 100644 --- a/net/rxrpc/call_event.c +++ b/net/rxrpc/call_event.c @@ -868,7 +868,6 @@ skip_msg_init: /* deal with events of a final nature */ if (test_bit(RXRPC_CALL_EV_RCVD_ERROR, &call->events)) { enum rxrpc_skb_mark mark; - int error; clear_bit(RXRPC_CALL_EV_CONN_ABORT, &call->events); clear_bit(RXRPC_CALL_EV_REJECT_BUSY, &call->events); @@ -876,10 +875,10 @@ skip_msg_init: if (call->completion == RXRPC_CALL_NETWORK_ERROR) { mark = RXRPC_SKB_MARK_NET_ERROR; - _debug("post net error %d", error); + _debug("post net error %d", call->error); } else { mark = RXRPC_SKB_MARK_LOCAL_ERROR; - _debug("post net local error %d", error); + _debug("post net local error %d", call->error); } if (rxrpc_post_message(call, mark, call->error, true) < 0) -- 2.9.0 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] rxrpc: remove duplicate 'error' variable 2016-09-06 13:25 [PATCH] rxrpc: remove duplicate 'error' variable Arnd Bergmann @ 2016-09-06 13:34 ` David Howells 2016-09-06 13:39 ` Arnd Bergmann 0 siblings, 1 reply; 3+ messages in thread From: David Howells @ 2016-09-06 13:34 UTC (permalink / raw) To: Arnd Bergmann; +Cc: dhowells, David S. Miller, netdev, linux-kernel Arnd Bergmann <arnd@arndb.de> wrote: > The rxrpc_process_call function has debug code to print a failure code, > but instead of printing the code from the rxrpc_call structure, it > prints an uninitialized variable: > > net/rxrpc/call_event.c: In function 'rxrpc_process_call': > net/rxrpc/call_event.c:879:58: error: 'error' may be used uninitialized in this function [-Werror=maybe-uninitialized] > > This removes the extraneous variable and prints the correct > code instead. > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > Fixes: f5c17aaeb2ae ("rxrpc: Calls should only have one terminal state") I've already posted a fix and it's waiting on DaveM. https://patchwork.ozlabs.org/patch/665550/ http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/commit/?h=rxrpc-rewrite&id=00b5407e427ac2588a2496b92035a94602b3cd1b David ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] rxrpc: remove duplicate 'error' variable 2016-09-06 13:34 ` David Howells @ 2016-09-06 13:39 ` Arnd Bergmann 0 siblings, 0 replies; 3+ messages in thread From: Arnd Bergmann @ 2016-09-06 13:39 UTC (permalink / raw) To: David Howells; +Cc: David S. Miller, netdev, linux-kernel On Tuesday, September 6, 2016 2:34:02 PM CEST David Howells wrote: > Arnd Bergmann <arnd@arndb.de> wrote: > > > The rxrpc_process_call function has debug code to print a failure code, > > but instead of printing the code from the rxrpc_call structure, it > > prints an uninitialized variable: > > > > net/rxrpc/call_event.c: In function 'rxrpc_process_call': > > net/rxrpc/call_event.c:879:58: error: 'error' may be used uninitialized in this function [-Werror=maybe-uninitialized] > > > > This removes the extraneous variable and prints the correct > > code instead. > > > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > > Fixes: f5c17aaeb2ae ("rxrpc: Calls should only have one terminal state") > > I've already posted a fix and it's waiting on DaveM. > > https://patchwork.ozlabs.org/patch/665550/ > > http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/commit/?h=rxrpc-rewrite&id=00b5407e427ac2588a2496b92035a94602b3cd1b Ok, good. At least I'm glad my patch is correct this time (being identical to yours). Arnd ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-09-06 13:39 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2016-09-06 13:25 [PATCH] rxrpc: remove duplicate 'error' variable Arnd Bergmann 2016-09-06 13:34 ` David Howells 2016-09-06 13:39 ` Arnd Bergmann
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.