Commit 242ddfc01499e83cd1e65e1dddb8c96b7f2ba2cc
1 parent
5e8d1eb5fb
nf_conntrack_proto_gre: 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 5 additions and 4 deletions Side-by-side Diff
net/netfilter/nf_conntrack_proto_gre.c
... | ... | @@ -321,10 +321,11 @@ |
321 | 321 | { |
322 | 322 | const unsigned int *timeouts = data; |
323 | 323 | |
324 | - NLA_PUT_BE32(skb, CTA_TIMEOUT_GRE_UNREPLIED, | |
325 | - htonl(timeouts[GRE_CT_UNREPLIED] / HZ)); | |
326 | - NLA_PUT_BE32(skb, CTA_TIMEOUT_GRE_REPLIED, | |
327 | - htonl(timeouts[GRE_CT_REPLIED] / HZ)); | |
324 | + if (nla_put_be32(skb, CTA_TIMEOUT_GRE_UNREPLIED, | |
325 | + htonl(timeouts[GRE_CT_UNREPLIED] / HZ)) || | |
326 | + nla_put_be32(skb, CTA_TIMEOUT_GRE_REPLIED, | |
327 | + htonl(timeouts[GRE_CT_REPLIED] / HZ))) | |
328 | + goto nla_put_failure; | |
328 | 329 | return 0; |
329 | 330 | |
330 | 331 | nla_put_failure: |