Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 3381
b: refs/heads/master
c: 9a5f04b
h: refs/heads/master
i:
  3379: d1271a5
v: v3
  • Loading branch information
Jesper Juhl authored and Linus Torvalds committed Jun 25, 2005
1 parent 7501415 commit c3f8d78
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 29 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: a2ba192c96d12447472e105890a9cd1b97952747
refs/heads/master: 9a5f04bf798254390f89445ecf0b6f4c70ddc1f8
3 changes: 1 addition & 2 deletions trunk/security/selinux/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -1658,9 +1658,8 @@ static int selinux_bprm_secureexec (struct linux_binprm *bprm)

static void selinux_bprm_free_security(struct linux_binprm *bprm)
{
struct bprm_security_struct *bsec = bprm->security;
kfree(bprm->security);
bprm->security = NULL;
kfree(bsec);
}

extern struct vfsmount *selinuxfs_mount;
Expand Down
9 changes: 3 additions & 6 deletions trunk/security/selinux/selinuxfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -951,8 +951,7 @@ static int sel_make_bools(void)
u32 sid;

/* remove any existing files */
if (bool_pending_values)
kfree(bool_pending_values);
kfree(bool_pending_values);

sel_remove_bools(dir);

Expand Down Expand Up @@ -997,10 +996,8 @@ static int sel_make_bools(void)
out:
free_page((unsigned long)page);
if (names) {
for (i = 0; i < num; i++) {
if (names[i])
kfree(names[i]);
}
for (i = 0; i < num; i++)
kfree(names[i]);
kfree(names);
}
return ret;
Expand Down
9 changes: 3 additions & 6 deletions trunk/security/selinux/ss/conditional.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,14 @@ static void cond_list_destroy(struct cond_node *list)

void cond_policydb_destroy(struct policydb *p)
{
if (p->bool_val_to_struct != NULL)
kfree(p->bool_val_to_struct);
kfree(p->bool_val_to_struct);
avtab_destroy(&p->te_cond_avtab);
cond_list_destroy(p->cond_list);
}

int cond_init_bool_indexes(struct policydb *p)
{
if (p->bool_val_to_struct)
kfree(p->bool_val_to_struct);
kfree(p->bool_val_to_struct);
p->bool_val_to_struct = (struct cond_bool_datum**)
kmalloc(p->p_bools.nprim * sizeof(struct cond_bool_datum*), GFP_KERNEL);
if (!p->bool_val_to_struct)
Expand All @@ -185,8 +183,7 @@ int cond_init_bool_indexes(struct policydb *p)

int cond_destroy_bool(void *key, void *datum, void *p)
{
if (key)
kfree(key);
kfree(key);
kfree(datum);
return 0;
}
Expand Down
15 changes: 5 additions & 10 deletions trunk/security/selinux/ss/policydb.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,17 +590,12 @@ void policydb_destroy(struct policydb *p)
hashtab_destroy(p->symtab[i].table);
}

for (i = 0; i < SYM_NUM; i++) {
if (p->sym_val_to_name[i])
kfree(p->sym_val_to_name[i]);
}
for (i = 0; i < SYM_NUM; i++)
kfree(p->sym_val_to_name[i]);

if (p->class_val_to_struct)
kfree(p->class_val_to_struct);
if (p->role_val_to_struct)
kfree(p->role_val_to_struct);
if (p->user_val_to_struct)
kfree(p->user_val_to_struct);
kfree(p->class_val_to_struct);
kfree(p->role_val_to_struct);
kfree(p->user_val_to_struct);

avtab_destroy(&p->te_avtab);

Expand Down
6 changes: 2 additions & 4 deletions trunk/security/selinux/ss/services.c
Original file line number Diff line number Diff line change
Expand Up @@ -1705,11 +1705,9 @@ int security_get_bools(int *len, char ***names, int **values)
err:
if (*names) {
for (i = 0; i < *len; i++)
if ((*names)[i])
kfree((*names)[i]);
kfree((*names)[i]);
}
if (*values)
kfree(*values);
kfree(*values);
goto out;
}

Expand Down

0 comments on commit c3f8d78

Please sign in to comment.