From: David S. Miller Date: Sun, 1 Apr 2012 22:52:31 +0000 (-0400) Subject: nf_conntrack_proto_generic: Stop using NLA_PUT*(). X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f577694143b8024e95b2c0b680ab2071424bb1c7;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 --- diff --git a/net/netfilter/nf_conntrack_proto_generic.c b/net/netfilter/nf_conntrack_proto_generic.c index 835e24c58f0d..d8923d54b358 100644 --- a/net/netfilter/nf_conntrack_proto_generic.c +++ b/net/netfilter/nf_conntrack_proto_generic.c @@ -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;