diff options
Diffstat (limited to 'security')
| -rw-r--r-- | security/keys/trusted-keys/trusted_tpm2.c | 4 | ||||
| -rw-r--r-- | security/selinux/hooks.c | 11 | 
2 files changed, 6 insertions, 9 deletions
diff --git a/security/keys/trusted-keys/trusted_tpm2.c b/security/keys/trusted-keys/trusted_tpm2.c index 0165da386289..2b2c8eb258d5 100644 --- a/security/keys/trusted-keys/trusted_tpm2.c +++ b/security/keys/trusted-keys/trusted_tpm2.c @@ -283,8 +283,8 @@ int tpm2_seal_trusted(struct tpm_chip *chip,  	/* key properties */  	flags = 0;  	flags |= options->policydigest_len ? 0 : TPM2_OA_USER_WITH_AUTH; -	flags |= payload->migratable ? (TPM2_OA_FIXED_TPM | -					TPM2_OA_FIXED_PARENT) : 0; +	flags |= payload->migratable ? 0 : (TPM2_OA_FIXED_TPM | +					    TPM2_OA_FIXED_PARENT);  	tpm_buf_append_u32(&buf, flags);  	/* policy */ diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index beceb89f68d9..1bbd53321d13 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -2600,8 +2600,9 @@ static int selinux_sb_eat_lsm_opts(char *options, void **mnt_opts)  				}  			}  			rc = selinux_add_opt(token, arg, mnt_opts); +			kfree(arg); +			arg = NULL;  			if (unlikely(rc)) { -				kfree(arg);  				goto free_opt;  			}  		} else { @@ -2792,17 +2793,13 @@ static int selinux_fs_context_parse_param(struct fs_context *fc,  					  struct fs_parameter *param)  {  	struct fs_parse_result result; -	int opt, rc; +	int opt;  	opt = fs_parse(fc, selinux_fs_parameters, param, &result);  	if (opt < 0)  		return opt; -	rc = selinux_add_opt(opt, param->string, &fc->security); -	if (!rc) -		param->string = NULL; - -	return rc; +	return selinux_add_opt(opt, param->string, &fc->security);  }  /* inode security operations */  | 
