From: Geert Uytterhoeven Date: Thu, 6 Oct 2016 13:41:49 +0000 (+0200) Subject: strparser: Propagate correct error code in strp_recv() X-Git-Tag: v5.15~12661^2~24 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6d3a4c404648e415e7d96e285d723936d4df7ed0;p=platform%2Fkernel%2Flinux-starfive.git strparser: Propagate correct error code in strp_recv() 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 Signed-off-by: David S. Miller --- diff --git a/net/strparser/strparser.c b/net/strparser/strparser.c index 5c7549b5b92c..41adf362936d 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 */