Skip to content

Commit

Permalink
gen_stats: Stop using NLA_PUT*().
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David S. Miller committed Apr 2, 2012
1 parent 0e3cea7 commit 14ad664
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/core/gen_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
static inline int
gnet_stats_copy(struct gnet_dump *d, int type, void *buf, int size)
{
NLA_PUT(d->skb, type, size, buf);
if (nla_put(d->skb, type, size, buf))
goto nla_put_failure;
return 0;

nla_put_failure:
Expand Down

0 comments on commit 14ad664

Please sign in to comment.