diff options
author | Davi Arnaut <davi.arnaut@gmail.com> | 2005-10-30 17:59:24 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-30 20:37:11 -0500 |
commit | bfd51626cbf61cb23f787d8ff972ef0d5ddacc0b (patch) | |
tree | 63e2a8e552b33509130822ed9222d7266cbeb69f /security/selinux/selinuxfs.c | |
parent | ce4c2bd1a9dfebaefadc2d34b17c6f12101751be (diff) |
[PATCH] SELinux: remove unecessary size_t checks in selinuxfs
This patch removes a bunch of unecessary checks for (size_t < 0) in
selinuxfs.
Signed-off-by: James Morris <jmorris@namei.org>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'security/selinux/selinuxfs.c')
-rw-r--r-- | security/selinux/selinuxfs.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c index 5f8427627211..7a387fec2a0c 100644 --- a/security/selinux/selinuxfs.c +++ b/security/selinux/selinuxfs.c | |||
@@ -105,7 +105,7 @@ static ssize_t sel_write_enforce(struct file * file, const char __user * buf, | |||
105 | ssize_t length; | 105 | ssize_t length; |
106 | int new_value; | 106 | int new_value; |
107 | 107 | ||
108 | if (count < 0 || count >= PAGE_SIZE) | 108 | if (count >= PAGE_SIZE) |
109 | return -ENOMEM; | 109 | return -ENOMEM; |
110 | if (*ppos != 0) { | 110 | if (*ppos != 0) { |
111 | /* No partial writes. */ | 111 | /* No partial writes. */ |
@@ -155,7 +155,7 @@ static ssize_t sel_write_disable(struct file * file, const char __user * buf, | |||
155 | int new_value; | 155 | int new_value; |
156 | extern int selinux_disable(void); | 156 | extern int selinux_disable(void); |
157 | 157 | ||
158 | if (count < 0 || count >= PAGE_SIZE) | 158 | if (count >= PAGE_SIZE) |
159 | return -ENOMEM; | 159 | return -ENOMEM; |
160 | if (*ppos != 0) { | 160 | if (*ppos != 0) { |
161 | /* No partial writes. */ | 161 | /* No partial writes. */ |
@@ -242,7 +242,7 @@ static ssize_t sel_write_load(struct file * file, const char __user * buf, | |||
242 | goto out; | 242 | goto out; |
243 | } | 243 | } |
244 | 244 | ||
245 | if ((count < 0) || (count > 64 * 1024 * 1024) | 245 | if ((count > 64 * 1024 * 1024) |
246 | || (data = vmalloc(count)) == NULL) { | 246 | || (data = vmalloc(count)) == NULL) { |
247 | length = -ENOMEM; | 247 | length = -ENOMEM; |
248 | goto out; | 248 | goto out; |
@@ -284,7 +284,7 @@ static ssize_t sel_write_context(struct file * file, const char __user * buf, | |||
284 | if (length) | 284 | if (length) |
285 | return length; | 285 | return length; |
286 | 286 | ||
287 | if (count < 0 || count >= PAGE_SIZE) | 287 | if (count >= PAGE_SIZE) |
288 | return -ENOMEM; | 288 | return -ENOMEM; |
289 | if (*ppos != 0) { | 289 | if (*ppos != 0) { |
290 | /* No partial writes. */ | 290 | /* No partial writes. */ |
@@ -332,7 +332,7 @@ static ssize_t sel_write_checkreqprot(struct file * file, const char __user * bu | |||
332 | if (length) | 332 | if (length) |
333 | return length; | 333 | return length; |
334 | 334 | ||
335 | if (count < 0 || count >= PAGE_SIZE) | 335 | if (count >= PAGE_SIZE) |
336 | return -ENOMEM; | 336 | return -ENOMEM; |
337 | if (*ppos != 0) { | 337 | if (*ppos != 0) { |
338 | /* No partial writes. */ | 338 | /* No partial writes. */ |
@@ -729,7 +729,7 @@ static ssize_t sel_read_bool(struct file *filep, char __user *buf, | |||
729 | if (!filep->f_op) | 729 | if (!filep->f_op) |
730 | goto out; | 730 | goto out; |
731 | 731 | ||
732 | if (count < 0 || count > PAGE_SIZE) { | 732 | if (count > PAGE_SIZE) { |
733 | ret = -EINVAL; | 733 | ret = -EINVAL; |
734 | goto out; | 734 | goto out; |
735 | } | 735 | } |
@@ -790,7 +790,7 @@ static ssize_t sel_write_bool(struct file *filep, const char __user *buf, | |||
790 | if (!filep->f_op) | 790 | if (!filep->f_op) |
791 | goto out; | 791 | goto out; |
792 | 792 | ||
793 | if (count < 0 || count >= PAGE_SIZE) { | 793 | if (count >= PAGE_SIZE) { |
794 | length = -ENOMEM; | 794 | length = -ENOMEM; |
795 | goto out; | 795 | goto out; |
796 | } | 796 | } |
@@ -848,7 +848,7 @@ static ssize_t sel_commit_bools_write(struct file *filep, | |||
848 | if (!filep->f_op) | 848 | if (!filep->f_op) |
849 | goto out; | 849 | goto out; |
850 | 850 | ||
851 | if (count < 0 || count >= PAGE_SIZE) { | 851 | if (count >= PAGE_SIZE) { |
852 | length = -ENOMEM; | 852 | length = -ENOMEM; |
853 | goto out; | 853 | goto out; |
854 | } | 854 | } |
@@ -1022,7 +1022,7 @@ static ssize_t sel_write_avc_cache_threshold(struct file * file, | |||
1022 | ssize_t ret; | 1022 | ssize_t ret; |
1023 | int new_value; | 1023 | int new_value; |
1024 | 1024 | ||
1025 | if (count < 0 || count >= PAGE_SIZE) { | 1025 | if (count >= PAGE_SIZE) { |
1026 | ret = -ENOMEM; | 1026 | ret = -ENOMEM; |
1027 | goto out; | 1027 | goto out; |
1028 | } | 1028 | } |