Commit 0a9876f3 authored by Michal Orzel's avatar Michal Orzel Committed by Paul Moore

selinux: Remove redundant assignments

Get rid of redundant assignments which end up in values not being
read either because they are overwritten or the function ends.

Reported by clang-tidy [deadcode.DeadStores]
Signed-off-by: default avatarMichal Orzel <michalorzel.eng@gmail.com>
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
parent 31231092
...@@ -1059,7 +1059,7 @@ int avc_has_extended_perms(struct selinux_state *state, ...@@ -1059,7 +1059,7 @@ int avc_has_extended_perms(struct selinux_state *state,
node = avc_lookup(state->avc, ssid, tsid, tclass); node = avc_lookup(state->avc, ssid, tsid, tclass);
if (unlikely(!node)) { if (unlikely(!node)) {
node = avc_compute_av(state, ssid, tsid, tclass, &avd, xp_node); avc_compute_av(state, ssid, tsid, tclass, &avd, xp_node);
} else { } else {
memcpy(&avd, &node->ae.avd, sizeof(avd)); memcpy(&avd, &node->ae.avd, sizeof(avd));
xp_node = node->ae.xp_node; xp_node = node->ae.xp_node;
...@@ -1151,7 +1151,7 @@ inline int avc_has_perm_noaudit(struct selinux_state *state, ...@@ -1151,7 +1151,7 @@ inline int avc_has_perm_noaudit(struct selinux_state *state,
node = avc_lookup(state->avc, ssid, tsid, tclass); node = avc_lookup(state->avc, ssid, tsid, tclass);
if (unlikely(!node)) if (unlikely(!node))
node = avc_compute_av(state, ssid, tsid, tclass, avd, &xp_node); avc_compute_av(state, ssid, tsid, tclass, avd, &xp_node);
else else
memcpy(avd, &node->ae.avd, sizeof(*avd)); memcpy(avd, &node->ae.avd, sizeof(*avd));
......
...@@ -6487,7 +6487,6 @@ static int selinux_setprocattr(const char *name, void *value, size_t size) ...@@ -6487,7 +6487,6 @@ static int selinux_setprocattr(const char *name, void *value, size_t size)
goto abort_change; goto abort_change;
/* Only allow single threaded processes to change context */ /* Only allow single threaded processes to change context */
error = -EPERM;
if (!current_is_single_threaded()) { if (!current_is_single_threaded()) {
error = security_bounded_transition(&selinux_state, error = security_bounded_transition(&selinux_state,
tsec->sid, sid); tsec->sid, sid);
......
...@@ -2980,7 +2980,6 @@ int security_fs_use(struct selinux_state *state, struct super_block *sb) ...@@ -2980,7 +2980,6 @@ int security_fs_use(struct selinux_state *state, struct super_block *sb)
} }
retry: retry:
rc = 0;
rcu_read_lock(); rcu_read_lock();
policy = rcu_dereference(state->policy); policy = rcu_dereference(state->policy);
policydb = &policy->policydb; policydb = &policy->policydb;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment