Commit f577694143b8024e95b2c0b680ab2071424bb1c7

Authored by David S. Miller
1 parent 242ddfc014

nf_conntrack_proto_generic: Stop using NLA_PUT*().

These macros contain a hidden goto, and are thus extremely error
prone and make code hard to audit.

Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff

net/netfilter/nf_conntrack_proto_generic.c
... ... @@ -90,7 +90,8 @@
90 90 {
91 91 const unsigned int *timeout = data;
92 92  
93   - NLA_PUT_BE32(skb, CTA_TIMEOUT_GENERIC_TIMEOUT, htonl(*timeout / HZ));
  93 + if (nla_put_be32(skb, CTA_TIMEOUT_GENERIC_TIMEOUT, htonl(*timeout / HZ)))
  94 + goto nla_put_failure;
94 95  
95 96 return 0;
96 97