Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 201890
b: refs/heads/master
c: 338437f
h: refs/heads/master
v: v3
  • Loading branch information
Dan Carpenter authored and James Morris committed Aug 2, 2010
1 parent 588b5cb commit 8decc43
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 38184c522249dc377366d4edc41dc500c2c3bb9e
refs/heads/master: 338437f6a09861cdf76e1396ed5fa6dee9c7cabe
13 changes: 8 additions & 5 deletions trunk/security/selinux/ss/conditional.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,34 +223,37 @@ int cond_read_bool(struct policydb *p, struct hashtab *h, void *fp)

booldatum = kzalloc(sizeof(struct cond_bool_datum), GFP_KERNEL);
if (!booldatum)
return -1;
return -ENOMEM;

rc = next_entry(buf, fp, sizeof buf);
if (rc < 0)
if (rc)
goto err;

booldatum->value = le32_to_cpu(buf[0]);
booldatum->state = le32_to_cpu(buf[1]);

rc = -EINVAL;
if (!bool_isvalid(booldatum))
goto err;

len = le32_to_cpu(buf[2]);

rc = -ENOMEM;
key = kmalloc(len + 1, GFP_KERNEL);
if (!key)
goto err;
rc = next_entry(key, fp, len);
if (rc < 0)
if (rc)
goto err;
key[len] = '\0';
if (hashtab_insert(h, key, booldatum))
rc = hashtab_insert(h, key, booldatum);
if (rc)
goto err;

return 0;
err:
cond_destroy_bool(key, booldatum, NULL);
return -1;
return rc;
}

struct cond_insertf_data {
Expand Down

0 comments on commit 8decc43

Please sign in to comment.