gen_stats: Stop using NLA_PUT*().
authorDavid S. Miller <davem@davemloft.net>
Mon, 2 Apr 2012 00:47:35 +0000 (20:47 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 2 Apr 2012 08:33:44 +0000 (04:33 -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/core/gen_stats.c

index 0452eb27a2724dcd3782f5acb15be04e7efba47e..ddedf211e588146f17eb2e147307d04991720170 100644 (file)
@@ -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:
This page took 0.026308 seconds and 5 git commands to generate.