diff options
author | 2017-01-16 22:02:57 +0800 | |
---|---|---|
committer | 2017-01-18 21:10:29 +0100 | |
commit | 1a28ad74ebd8f9d3c7eae0d781f72a6d30545e17 (patch) | |
tree | 68077f2dc96b219a6affd14d3c0ef76dd255c571 /net/sched/cls_flow.c | |
parent | netfilter: nft_meta: deal with PACKET_LOOPBACK in netdev family (diff) | |
download | wireguard-linux-1a28ad74ebd8f9d3c7eae0d781f72a6d30545e17.tar.xz wireguard-linux-1a28ad74ebd8f9d3c7eae0d781f72a6d30545e17.zip |
netfilter: nf_tables: eliminate useless condition checks
The return value of nf_tables_table_lookup() is valid pointer or one
pointer error. There are two cases:
1) IS_ERR(table) is true, it would return the error or reset the
table as NULL, it is unnecessary to perform the latter check
"table != NULL".
2) IS_ERR(obj) is false, the table is one valid pointer. It is also
unnecessary to perform that check.
The nf_tables_newset() and nf_tables_newobj() have same logic codes.
In summary, we could move the block of condition check "table != NULL"
in the else block to eliminate the original condition checks.
Signed-off-by: Gao Feng <fgao@ikuai8.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/sched/cls_flow.c')
0 files changed, 0 insertions, 0 deletions