Skip to contentSkip to conversation

netlink: Use FIELD_SIZEOF() in netlink_proto_init().

PATCH In review YOSHIFUJI Hideaki 1 participant 1 message Jan 9, 2013

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

PATCH 3/6 netlink: Use FIELD_SIZEOF() in netlink_proto_init().

---
 net/netlink/af_netlink.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
net/netlink/af_netlink.c +1 -2
index c0353d5..74827e3 100644
@@ -2185,7 +2185,6 @@ static struct pernet_operations __net_initdata netlink_net_ops = {
 
 static int __init netlink_proto_init(void)
 {
-	struct sk_buff *dummy_skb;
 	int i;
 	unsigned long limit;
 	unsigned int order;
@@ -2194,7 +2193,7 @@ static int __init netlink_proto_init(void)
 	if (err != 0)
 		goto out;
 
-	BUILD_BUG_ON(sizeof(struct netlink_skb_parms) > sizeof(dummy_skb->cb));
+	BUILD_BUG_ON(sizeof(struct netlink_skb_parms) > FIELD_SIZEOF(struct sk_buff, cb));
 
 	nl_table = kcalloc(MAX_LINKS, sizeof(*nl_table), GFP_KERNEL);
 	if (!nl_table)
Signature · 1 line
1.7.9.5