Skip to contentSkip to conversation

: Mark attribute construction exception unlikely

NETLINK Applied Patrick McHardy 2 participants 2 messages Dec 5, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

[NETLINK]: Mark attribute construction exception unlikely

---
commit 9fce717f589c67137fbfc3b202d3d107dd613ad7
tree efc61e4abeeb2a89cad629c719e528364fb8dcdd
parent d426bc47b4c14d6d60b35d1b79c7d598704bbf04
author Patrick McHardy <[email protected]> Tue, 04 Dec 2007 10:48:28 +0100 committer Patrick McHardy <[email protected]> Wed, 05 Dec 2007 12:17:13 +0100

 include/linux/netlink.h |    2 +-
 include/net/netlink.h   |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
include/linux/netlink.h +1 -1
index d5bfaba..2aee0f5 100644
@@ -245,7 +245,7 @@ __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags)
 }
 
 #define NLMSG_NEW(skb, pid, seq, type, len, flags) \
-({	if (skb_tailroom(skb) < (int)NLMSG_SPACE(len)) \
+({	if (unlikely(skb_tailroom(skb) < (int)NLMSG_SPACE(len))) \
 		goto nlmsg_failure; \
 	__nlmsg_put(skb, pid, seq, type, len, flags); })
 
include/net/netlink.h +1 -1
index 9298218..db4b935 100644
@@ -862,7 +862,7 @@ static inline int nla_put_msecs(struct sk_buff *skb, int attrtype,
 
 #define NLA_PUT(skb, attrtype, attrlen, data) \
 	do { \
-		if (nla_put(skb, attrtype, attrlen, data) < 0) \
+		if (unlikely(nla_put(skb, attrtype, attrlen, data) < 0)) \
 			goto nla_put_failure; \
 	} while(0)