All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] strparser: Propagate correct error code in strp_recv()
@ 2016-10-06 13:41 Geert Uytterhoeven
  2016-10-12  5:52 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2016-10-06 13:41 UTC (permalink / raw)
  To: David S. Miller, Tom Herbert; +Cc: netdev, linux-kernel, Geert Uytterhoeven

With m68k-linux-gnu-gcc-4.1:

    net/strparser/strparser.c: In function ‘strp_recv’:
    net/strparser/strparser.c:98: warning: ‘err’ may be used uninitialized in this function

Pass "len" (which is an error code when negative) instead of the
uninitialized "err" variable to fix this.

Fixes: 43a0c6751a322847 ("strparser: Stream parser for messages")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
Compile-tested only.
---
 net/strparser/strparser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/strparser/strparser.c b/net/strparser/strparser.c
index 5c7549b5b92cd23c..41adf362936d7dc4 100644
--- a/net/strparser/strparser.c
+++ b/net/strparser/strparser.c
@@ -246,7 +246,7 @@ static int strp_recv(read_descriptor_t *desc, struct sk_buff *orig_skb,
 				} else {
 					strp->rx_interrupted = 1;
 				}
-				strp_parser_err(strp, err, desc);
+				strp_parser_err(strp, len, desc);
 				break;
 			} else if (len > strp->sk->sk_rcvbuf) {
 				/* Message length exceeds maximum allowed */
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] strparser: Propagate correct error code in strp_recv()
  2016-10-06 13:41 [PATCH] strparser: Propagate correct error code in strp_recv() Geert Uytterhoeven
@ 2016-10-12  5:52 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-10-12  5:52 UTC (permalink / raw)
  To: geert; +Cc: tom, netdev, linux-kernel

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: Thu,  6 Oct 2016 15:41:49 +0200

> With m68k-linux-gnu-gcc-4.1:
> 
>     net/strparser/strparser.c: In function ‘strp_recv’:
>     net/strparser/strparser.c:98: warning: ‘err’ may be used uninitialized in this function
> 
> Pass "len" (which is an error code when negative) instead of the
> uninitialized "err" variable to fix this.
> 
> Fixes: 43a0c6751a322847 ("strparser: Stream parser for messages")
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

Applied and queued up for -stable, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-10-12  6:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-06 13:41 [PATCH] strparser: Propagate correct error code in strp_recv() Geert Uytterhoeven
2016-10-12  5:52 ` David Miller

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.