SELinux - remove unecessary size_t checks in selinuxfs
PATCH 1/1 SELinux - remove unecessary size_t checks in selinuxfs
This patch removes a bunch of unecessary checks for (size_t < 0) in selinuxfs.
Please apply.
Author: Davi Arnaut <[email protected]>
Signed-off-by James Morris <[email protected]>
Acked-by Stephen Smalley <[email protected]>
---
security/selinux/selinuxfs.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-)
security/selinux/selinuxfs.c +9 -9
@@ -105,7 +105,7 @@ static ssize_t sel_write_enforce(structssize_t length;int new_value; -if (count <0 || count >=PAGE_SIZE ) +if (count >=PAGE_SIZE )return -ENOMEM ;if (*ppos !=0 ) {/* No partial writes. */
@@ -155,7 +155,7 @@ static ssize_t sel_write_disable(structint new_value;extern int selinux_disable (void ); -if (count <0 || count >=PAGE_SIZE ) +if (count >=PAGE_SIZE )return -ENOMEM ;if (*ppos !=0 ) {/* No partial writes. */
@@ -242,7 +242,7 @@ static ssize_t sel_write_load(struct fil goto out; } -if ((count <0 ) || (count >64 *1024 *1024 ) +if ((count >64 *1024 *1024 ) || (data =vmalloc (count)) ==NULL ) { length = -ENOMEM ; goto out;
@@ -284,7 +284,7 @@ static ssize_t sel_write_context(structif (length)return length; -if (count <0 || count >=PAGE_SIZE ) +if (count >=PAGE_SIZE )return -ENOMEM ;if (*ppos !=0 ) {/* No partial writes. */
@@ -332,7 +332,7 @@ static ssize_t sel_write_checkreqprot(stif (length)return length; -if (count <0 || count >=PAGE_SIZE ) +if (count >=PAGE_SIZE )return -ENOMEM ;if (*ppos !=0 ) {/* No partial writes. */
@@ -739,7 +739,7 @@ static ssize_t sel_read_bool(struct fileif (!filep->f_op) goto out; -if (count <0 || count >PAGE_SIZE ) { +if (count >PAGE_SIZE ) { ret = -EINVAL ; goto out; }
@@ -800,7 +800,7 @@ static ssize_t sel_write_bool(struct filif (!filep->f_op) goto out; -if (count <0 || count >=PAGE_SIZE ) { +if (count >=PAGE_SIZE ) { length = -ENOMEM ; goto out; }
@@ -858,7 +858,7 @@ static ssize_t sel_commit_bools_write(stif (!filep->f_op) goto out; -if (count <0 || count >=PAGE_SIZE ) { +if (count >=PAGE_SIZE ) { length = -ENOMEM ; goto out; }
@@ -1032,7 +1032,7 @@ static ssize_t sel_write_avc_cache_thresssize_t ret;int new_value; -if (count <0 || count >=PAGE_SIZE ) { +if (count >=PAGE_SIZE ) { ret = -ENOMEM ; goto out; }