aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Morris <james.l.morris@oracle.com>2015-06-12 19:51:16 -0400
committerJames Morris <james.l.morris@oracle.com>2015-06-12 19:51:16 -0400
commitd6f7aa27f41db6f556dba0185228a0b90a2a0980 (patch)
treebdd9e255ba89d0def8690f383bc2b4be62ccbc80
parent9fc2b4b436cff7d8403034676014f1be9d534942 (diff)
parent5430209497eeb01415c681aaac0d00f65d24a526 (diff)
Merge branch 'smack-for-4.2-stacked' of https://github.com/cschaufler/smack-next into next
-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 = {
2253static ssize_t smk_write_revoke_subj(struct file *file, const char __user *buf, 2253static ssize_t smk_write_revoke_subj(struct file *file, const char __user *buf,
2254 size_t count, loff_t *ppos) 2254 size_t count, loff_t *ppos)
2255{ 2255{
2256 char *data = NULL; 2256 char *data;
2257 const char *cp = NULL; 2257 const char *cp;
2258 struct smack_known *skp; 2258 struct smack_known *skp;
2259 struct smack_rule *sp; 2259 struct smack_rule *sp;
2260 struct list_head *rule_list; 2260 struct list_head *rule_list;
@@ -2276,18 +2276,18 @@ static ssize_t smk_write_revoke_subj(struct file *file, const char __user *buf,
2276 2276
2277 if (copy_from_user(data, buf, count) != 0) { 2277 if (copy_from_user(data, buf, count) != 0) {
2278 rc = -EFAULT; 2278 rc = -EFAULT;
2279 goto free_out; 2279 goto out_data;
2280 } 2280 }
2281 2281
2282 cp = smk_parse_smack(data, count); 2282 cp = smk_parse_smack(data, count);
2283 if (IS_ERR(cp)) { 2283 if (IS_ERR(cp)) {
2284 rc = PTR_ERR(cp); 2284 rc = PTR_ERR(cp);
2285 goto free_out; 2285 goto out_data;
2286 } 2286 }
2287 2287
2288 skp = smk_find_entry(cp); 2288 skp = smk_find_entry(cp);
2289 if (skp == NULL) 2289 if (skp == NULL)
2290 goto free_out; 2290 goto out_cp;
2291 2291
2292 rule_list = &skp->smk_rules; 2292 rule_list = &skp->smk_rules;
2293 rule_lock = &skp->smk_rules_lock; 2293 rule_lock = &skp->smk_rules_lock;
@@ -2299,9 +2299,11 @@ static ssize_t smk_write_revoke_subj(struct file *file, const char __user *buf,
2299 2299
2300 mutex_unlock(rule_lock); 2300 mutex_unlock(rule_lock);
2301 2301
2302free_out: 2302out_cp:
2303 kfree(data);
2304 kfree(cp); 2303 kfree(cp);
2304out_data:
2305 kfree(data);
2306
2305 return rc; 2307 return rc;
2306} 2308}
2307 2309