Skip to content

Commit

Permalink
strparser: Propagate correct error code in strp_recv()
Browse files Browse the repository at this point in the history
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: 43a0c67 ("strparser: Stream parser for messages")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
geertu authored and davem330 committed Oct 12, 2016
1 parent 6b25e21 commit 6d3a4c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/strparser/strparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 6d3a4c4

Please sign in to comment.