Skip to content

Commit 648e45d

Browse files
tobluxjrjohansen
authored andcommitted
apparmor: Remove unnecessary NULL check before kvfree()
Since kvfree() already checks if its argument is NULL, an additional check before calling kvfree() is unnecessary and can be removed. Remove it and the following Coccinelle/coccicheck warning reported by ifnullfree.cocci: WARNING: NULL check before some freeing functions is not needed Signed-off-by: Thorsten Blum <[email protected]> Signed-off-by: John Johansen <[email protected]>
1 parent ab6875f commit 648e45d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

security/apparmor/policy.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ static void aa_free_pdb(struct aa_policydb *pdb)
103103
{
104104
if (pdb) {
105105
aa_put_dfa(pdb->dfa);
106-
if (pdb->perms)
107-
kvfree(pdb->perms);
106+
kvfree(pdb->perms);
108107
aa_free_str_table(&pdb->trans);
109108
kfree(pdb);
110109
}

0 commit comments

Comments
 (0)