Преглед на файлове

gen_stats: 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>
David S. Miller преди 13 години
родител
ревизия
14ad6647f3
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      net/core/gen_stats.c

+ 2 - 1
net/core/gen_stats.c

@@ -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: