netfilter: nft_compat: fix error path in nft_parse_compat()
authorPablo Neira Ayuso <pablo@netfilter.org>
Sat, 16 Nov 2013 21:16:47 +0000 (22:16 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 18 Nov 2013 11:53:41 +0000 (12:53 +0100)
commit8691a9a3382f17fbf1ed808c956672c70369a2e0
tree58ebe72586dbeb2151359c296365fbfa8f7e54d0
parent23dfe136e2bf8d9ea1095704c535368a9bc721da
netfilter: nft_compat: fix error path in nft_parse_compat()

The patch 0ca743a55991: "netfilter: nf_tables: add compatibility
layer for x_tables", leads to the following Smatch

 warning: "net/netfilter/nft_compat.c:140 nft_parse_compat()
          warn: signedness bug returning '(-34)'"

This nft_parse_compat function returns error codes but the return
type is u8 so the error codes are transformed into small positive
values. The callers don't check the return.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nft_compat.c