diff --git a/include/net/sock.h b/include/net/sock.h
index 941ad7c830a392d87d1df847e1dabfb642ee52dd..08291c1be41eb4143b8fd60326838548690e3532 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -271,7 +271,9 @@ struct sock {
 	struct sk_buff		*sk_send_head;
 	__u32			sk_sndmsg_off;
 	int			sk_write_pending;
+#ifdef CONFIG_SECURITY
 	void			*sk_security;
+#endif
 	__u32			sk_mark;
 	/* XXX 4 bytes hole on 64 bit */
 	void			(*sk_state_change)(struct sock *sk);