diff options
author | Ondrej Mosnacek <omosnace@redhat.com> | 2019-03-25 04:11:15 -0400 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2019-03-25 10:25:06 -0400 |
commit | 9e0cfe28fa32f6fefd831192a4d0b19c804c746b (patch) | |
tree | 128cf5a7abfcc3f1756159be339abb81b72d550d /security | |
parent | 24f7c45fdb2a17ef6ad3142e9a8ba4066ac674a2 (diff) |
selinux: remove useless assignments
The code incorrectly assigned directly to the variables instead of the
values they point to. Since the values are already set to NULL/0 at the
beginning of the function, we can simply remove these useless
assignments.
Reported-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Fixes: fede148324c3 ("selinux: log invalid contexts in AVCs")
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
[PM: removed a bad comment that was causing compiler warnings]
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security')
-rw-r--r-- | security/selinux/ss/services.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c index ec62918521b1..cc043bc8fd4c 100644 --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c | |||
@@ -1318,14 +1318,11 @@ static int security_sid_to_context_core(struct selinux_state *state, | |||
1318 | rc = -EINVAL; | 1318 | rc = -EINVAL; |
1319 | goto out_unlock; | 1319 | goto out_unlock; |
1320 | } | 1320 | } |
1321 | if (only_invalid && !context->len) { | 1321 | if (only_invalid && !context->len) |
1322 | scontext = NULL; | ||
1323 | scontext_len = 0; | ||
1324 | rc = 0; | 1322 | rc = 0; |
1325 | } else { | 1323 | else |
1326 | rc = context_struct_to_string(policydb, context, scontext, | 1324 | rc = context_struct_to_string(policydb, context, scontext, |
1327 | scontext_len); | 1325 | scontext_len); |
1328 | } | ||
1329 | out_unlock: | 1326 | out_unlock: |
1330 | read_unlock(&state->ss->policy_rwlock); | 1327 | read_unlock(&state->ss->policy_rwlock); |
1331 | out: | 1328 | out: |