[PATCH] selinux: remove redundant assignment to len

Subsystems: selinux security module, the rest

STALE3211d

2 messages, 2 authors, 2017-10-16 · open the first message on its own page

[PATCH] selinux: remove redundant assignment to len

From: Colin King <hidden>
Date: 2017-10-14 15:00:57

From: Colin Ian King <redacted>

The variable len is being set to zero and this value is never
being read since len is being set to a different value just
a few lines later.  Remove this redundant assignment. Cleans
up clang warning: Value stored to 'len' is never read

Signed-off-by: Colin Ian King <redacted>
---
 security/selinux/ss/conditional.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/security/selinux/ss/conditional.c b/security/selinux/ss/conditional.c
index 771c96afe1d5..c91543a617ac 100644
--- a/security/selinux/ss/conditional.c
+++ b/security/selinux/ss/conditional.c
@@ -361,7 +361,6 @@ static int cond_read_av_list(struct policydb *p, void *fp, struct cond_av_list *
 
 	*ret_list = NULL;
 
-	len = 0;
 	rc = next_entry(buf, fp, sizeof(u32));
 	if (rc)
 		return rc;
-- 
2.14.1

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Re: [PATCH] selinux: remove redundant assignment to len

From: Paul Moore <paul@paul-moore.com>
Date: 2017-10-16 22:37:58

On Sat, Oct 14, 2017 at 11:00 AM, Colin King [off-list ref] wrote:
From: Colin Ian King <redacted>

The variable len is being set to zero and this value is never
being read since len is being set to a different value just
a few lines later.  Remove this redundant assignment. Cleans
up clang warning: Value stored to 'len' is never read

Signed-off-by: Colin Ian King <redacted>
---
 security/selinux/ss/conditional.c | 1 -
 1 file changed, 1 deletion(-)
Merged.
quoted hunk
diff --git a/security/selinux/ss/conditional.c b/security/selinux/ss/conditional.c
index 771c96afe1d5..c91543a617ac 100644
--- a/security/selinux/ss/conditional.c
+++ b/security/selinux/ss/conditional.c
@@ -361,7 +361,6 @@ static int cond_read_av_list(struct policydb *p, void *fp, struct cond_av_list *

        *ret_list = NULL;

-       len = 0;
        rc = next_entry(buf, fp, sizeof(u32));
        if (rc)
                return rc;
--
2.14.1
-- 
paul moore
www.paul-moore.com
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help