Patchwork [net-next,6/6] unix: Use FIELD_SIZEOF() in af_unix_init().

login
register
mail settings
Submitter YOSHIFUJI Hideaki / 吉藤英明
Date Jan. 9, 2013, 5:20 p.m.
Message ID <50EDA6C7.30205@linux-ipv6.org>
Download mbox | patch
Permalink /patch/210799/
State Accepted
Delegated to: David Miller
Headers show

Comments

YOSHIFUJI Hideaki / 吉藤英明 - Jan. 9, 2013, 5:20 p.m.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
---
 net/unix/af_unix.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Patch

diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 5b5c876..0c61236 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -2426,9 +2426,8 @@  static struct pernet_operations unix_net_ops = {
 static int __init af_unix_init(void)
 {
 	int rc = -1;
-	struct sk_buff *dummy_skb;
 
-	BUILD_BUG_ON(sizeof(struct unix_skb_parms) > sizeof(dummy_skb->cb));
+	BUILD_BUG_ON(sizeof(struct unix_skb_parms) > FIELD_SIZEOF(struct sk_buff, cb));
 
 	rc = proto_register(&unix_proto, 1);
 	if (rc != 0) {