summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorJames Morris <james.l.morris@oracle.com>2015-06-13 09:51:16 +1000
committerJames Morris <james.l.morris@oracle.com>2015-06-13 09:51:16 +1000
commitd6f7aa27f41db6f556dba0185228a0b90a2a0980 (patch)
treebdd9e255ba89d0def8690f383bc2b4be62ccbc80 /security
parent9fc2b4b436cff7d8403034676014f1be9d534942 (diff)
parent5430209497eeb01415c681aaac0d00f65d24a526 (diff)
downloadlinux-rpi-d6f7aa27f41db6f556dba0185228a0b90a2a0980.tar.gz
linux-rpi-d6f7aa27f41db6f556dba0185228a0b90a2a0980.tar.bz2
linux-rpi-d6f7aa27f41db6f556dba0185228a0b90a2a0980.zip
Merge branch 'smack-for-4.2-stacked' of https://github.com/cschaufler/smack-next into next
Diffstat (limited to 'security')
-rw-r--r--security/smack/smackfs.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c
index f1c22a891b1a..5e0a64ebdf23 100644
--- a/security/smack/smackfs.c
+++ b/security/smack/smackfs.c
@@ -2253,8 +2253,8 @@ static const struct file_operations smk_access2_ops = {
static ssize_t smk_write_revoke_subj(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
- char *data = NULL;
- const char *cp = NULL;
+ char *data;
+ const char *cp;
struct smack_known *skp;
struct smack_rule *sp;
struct list_head *rule_list;
@@ -2276,18 +2276,18 @@ static ssize_t smk_write_revoke_subj(struct file *file, const char __user *buf,
if (copy_from_user(data, buf, count) != 0) {
rc = -EFAULT;
- goto free_out;
+ goto out_data;
}
cp = smk_parse_smack(data, count);
if (IS_ERR(cp)) {
rc = PTR_ERR(cp);
- goto free_out;
+ goto out_data;
}
skp = smk_find_entry(cp);
if (skp == NULL)
- goto free_out;
+ goto out_cp;
rule_list = &skp->smk_rules;
rule_lock = &skp->smk_rules_lock;
@@ -2299,9 +2299,11 @@ static ssize_t smk_write_revoke_subj(struct file *file, const char __user *buf,
mutex_unlock(rule_lock);
-free_out:
- kfree(data);
+out_cp:
kfree(cp);
+out_data:
+ kfree(data);
+
return rc;
}