strparser: Propagate correct error code in strp_recv()
authorGeert Uytterhoeven <geert@linux-m68k.org>
Thu, 6 Oct 2016 13:41:49 +0000 (15:41 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 12 Oct 2016 05:51:49 +0000 (01:51 -0400)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/strparser/strparser.c

index 5c7549b5b92cd23c551fc65775d1abbd4aa768cb..41adf362936d7dc4035cf9db7d7962f8dafcad0d 100644 (file)
@@ -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 */