]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
nf_conntrack_proto_generic: Stop using NLA_PUT*().
authorDavid S. Miller <davem@davemloft.net>
Sun, 1 Apr 2012 22:52:31 +0000 (18:52 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sun, 1 Apr 2012 22:52:31 +0000 (18:52 -0400)
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>
net/netfilter/nf_conntrack_proto_generic.c

index 835e24c58f0de3ab67977aad017d456a840e28ce..d8923d54b3585bf579c66eaba82dc4ec7d464236 100644 (file)
@@ -90,7 +90,8 @@ generic_timeout_obj_to_nlattr(struct sk_buff *skb, const void *data)
 {
        const unsigned int *timeout = data;
 
-       NLA_PUT_BE32(skb, CTA_TIMEOUT_GENERIC_TIMEOUT, htonl(*timeout / HZ));
+       if (nla_put_be32(skb, CTA_TIMEOUT_GENERIC_TIMEOUT, htonl(*timeout / HZ)))
+               goto nla_put_failure;
 
        return 0;