aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2008-04-18 17:38:24 -0400
committerJames Morris <jmorris@namei.org>2008-04-21 05:05:05 -0400
commitc544c028e45feceeb48b629456d0eb43adc8eaaf (patch)
treefeb455ffd74d43df3667f1f59688e10e14f627fd /security
parenta6aaafeecca7ea1ddb5d7dac09e468ae14751fcd (diff)
SELinux: netlink.c whitespace, syntax, and static declaraction cleanups
This patch changes netlink.c to fix whitespace and syntax issues. Things that are fixed may include (does not not have to include) whitespace at end of lines spaces followed by tabs spaces used instead of tabs spacing around parenthesis locateion of { around struct and else clauses location of * in pointer declarations removal of initialization of static data to keep it in the right section useless {} in if statemetns useless checking for NULL before kfree fixing of the indentation depth of switch statements and any number of other things I forgot to mention Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security')
-rw-r--r--security/selinux/netlink.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/security/selinux/netlink.c b/security/selinux/netlink.c
index 6214a7a73149..1ae556446e65 100644
--- a/security/selinux/netlink.c
+++ b/security/selinux/netlink.c
@@ -24,16 +24,16 @@ static struct sock *selnl;
24static int selnl_msglen(int msgtype) 24static int selnl_msglen(int msgtype)
25{ 25{
26 int ret = 0; 26 int ret = 0;
27 27
28 switch (msgtype) { 28 switch (msgtype) {
29 case SELNL_MSG_SETENFORCE: 29 case SELNL_MSG_SETENFORCE:
30 ret = sizeof(struct selnl_msg_setenforce); 30 ret = sizeof(struct selnl_msg_setenforce);
31 break; 31 break;
32 32
33 case SELNL_MSG_POLICYLOAD: 33 case SELNL_MSG_POLICYLOAD:
34 ret = sizeof(struct selnl_msg_policyload); 34 ret = sizeof(struct selnl_msg_policyload);
35 break; 35 break;
36 36
37 default: 37 default:
38 BUG(); 38 BUG();
39 } 39 }
@@ -45,15 +45,15 @@ static void selnl_add_payload(struct nlmsghdr *nlh, int len, int msgtype, void *
45 switch (msgtype) { 45 switch (msgtype) {
46 case SELNL_MSG_SETENFORCE: { 46 case SELNL_MSG_SETENFORCE: {
47 struct selnl_msg_setenforce *msg = NLMSG_DATA(nlh); 47 struct selnl_msg_setenforce *msg = NLMSG_DATA(nlh);
48 48
49 memset(msg, 0, len); 49 memset(msg, 0, len);
50 msg->val = *((int *)data); 50 msg->val = *((int *)data);
51 break; 51 break;
52 } 52 }
53 53
54 case SELNL_MSG_POLICYLOAD: { 54 case SELNL_MSG_POLICYLOAD: {
55 struct selnl_msg_policyload *msg = NLMSG_DATA(nlh); 55 struct selnl_msg_policyload *msg = NLMSG_DATA(nlh);
56 56
57 memset(msg, 0, len); 57 memset(msg, 0, len);
58 msg->seqno = *((u32 *)data); 58 msg->seqno = *((u32 *)data);
59 break; 59 break;
@@ -70,9 +70,9 @@ static void selnl_notify(int msgtype, void *data)
70 sk_buff_data_t tmp; 70 sk_buff_data_t tmp;
71 struct sk_buff *skb; 71 struct sk_buff *skb;
72 struct nlmsghdr *nlh; 72 struct nlmsghdr *nlh;
73 73
74 len = selnl_msglen(msgtype); 74 len = selnl_msglen(msgtype);
75 75
76 skb = alloc_skb(NLMSG_SPACE(len), GFP_USER); 76 skb = alloc_skb(NLMSG_SPACE(len), GFP_USER);
77 if (!skb) 77 if (!skb)
78 goto oom; 78 goto oom;
@@ -85,7 +85,7 @@ static void selnl_notify(int msgtype, void *data)
85 netlink_broadcast(selnl, skb, 0, SELNLGRP_AVC, GFP_USER); 85 netlink_broadcast(selnl, skb, 0, SELNLGRP_AVC, GFP_USER);
86out: 86out:
87 return; 87 return;
88 88
89nlmsg_failure: 89nlmsg_failure:
90 kfree_skb(skb); 90 kfree_skb(skb);
91oom: 91oom:
@@ -109,7 +109,7 @@ static int __init selnl_init(void)
109 SELNLGRP_MAX, NULL, NULL, THIS_MODULE); 109 SELNLGRP_MAX, NULL, NULL, THIS_MODULE);
110 if (selnl == NULL) 110 if (selnl == NULL)
111 panic("SELinux: Cannot create netlink socket."); 111 panic("SELinux: Cannot create netlink socket.");
112 netlink_set_nonroot(NETLINK_SELINUX, NL_NONROOT_RECV); 112 netlink_set_nonroot(NETLINK_SELINUX, NL_NONROOT_RECV);
113 return 0; 113 return 0;
114} 114}
115 115