mirror of
https://github.com/torvalds/linux.git
synced 2024-12-25 12:21:37 +00:00
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: Michal Orzel <michalorzel.eng@gmail.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
This commit is contained in:
parent
3123109284
commit
0a9876f36b
@ -1059,7 +1059,7 @@ int avc_has_extended_perms(struct selinux_state *state,
|
||||
|
||||
node = avc_lookup(state->avc, ssid, tsid, tclass);
|
||||
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 {
|
||||
memcpy(&avd, &node->ae.avd, sizeof(avd));
|
||||
xp_node = node->ae.xp_node;
|
||||
@ -1151,7 +1151,7 @@ inline int avc_has_perm_noaudit(struct selinux_state *state,
|
||||
|
||||
node = avc_lookup(state->avc, ssid, tsid, tclass);
|
||||
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
|
||||
memcpy(avd, &node->ae.avd, sizeof(*avd));
|
||||
|
||||
|
@ -6487,7 +6487,6 @@ static int selinux_setprocattr(const char *name, void *value, size_t size)
|
||||
goto abort_change;
|
||||
|
||||
/* Only allow single threaded processes to change context */
|
||||
error = -EPERM;
|
||||
if (!current_is_single_threaded()) {
|
||||
error = security_bounded_transition(&selinux_state,
|
||||
tsec->sid, sid);
|
||||
|
@ -2980,7 +2980,6 @@ int security_fs_use(struct selinux_state *state, struct super_block *sb)
|
||||
}
|
||||
|
||||
retry:
|
||||
rc = 0;
|
||||
rcu_read_lock();
|
||||
policy = rcu_dereference(state->policy);
|
||||
policydb = &policy->policydb;
|
||||
|
Loading…
Reference in New Issue
Block a user