From: Patrick McHardy Date: Mon, 13 Mar 2006 04:40:43 +0000 (-0800) Subject: [NETFILTER]: arp_tables: fix NULL pointer dereference X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=31fe4d331729e9687db84521c3ceb8e43390efcf;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [NETFILTER]: arp_tables: fix NULL pointer dereference The check is wrong and lets NULL-ptrs slip through since !IS_ERR(NULL) is true. Coverity #190 Signed-off-by: Patrick McHardy Signed-off-by: David S. Miller --- diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c index dd1048be8a01..7d7ab94a7a2e 100644 --- a/net/ipv4/netfilter/arp_tables.c +++ b/net/ipv4/netfilter/arp_tables.c @@ -771,7 +771,7 @@ static int get_entries(const struct arpt_get_entries *entries, struct arpt_table *t; t = xt_find_table_lock(NF_ARP, entries->name); - if (t || !IS_ERR(t)) { + if (t && !IS_ERR(t)) { struct xt_table_info *private = t->private; duprintf("t->private->number = %u\n", private->number);