Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1496661 > unrolled thread

[PATCH] strparser: Propagate correct error code in strp_recv()

Started byGeert Uytterhoeven <geert@linux-m68k.org>
First post2016-10-06 15:50 +0200
Last post2016-10-12 08:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] strparser: Propagate correct error code in strp_recv() Geert Uytterhoeven <geert@linux-m68k.org> - 2016-10-06 15:50 +0200
    Re: [PATCH] strparser: Propagate correct error code in strp_recv() David Miller <davem@davemloft.net> - 2016-10-12 08:10 +0200

#1496661 — [PATCH] strparser: Propagate correct error code in strp_recv()

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2016-10-06 15:50 +0200
Subject[PATCH] strparser: Propagate correct error code in strp_recv()
Message-ID<sphdE-Kt-25@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1499365

FromDavid Miller <davem@davemloft.net>
Date2016-10-12 08:10 +0200
Message-ID<srkTL-ql-11@gated-at.bofh.it>
In reply to#1496661
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.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web