mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2024-12-28 16:53:49 +00:00
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 <thorsten.blum@linux.dev> Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
parent
ab6875fbb9
commit
648e45d724
@ -103,8 +103,7 @@ static void aa_free_pdb(struct aa_policydb *pdb)
|
||||
{
|
||||
if (pdb) {
|
||||
aa_put_dfa(pdb->dfa);
|
||||
if (pdb->perms)
|
||||
kvfree(pdb->perms);
|
||||
kvfree(pdb->perms);
|
||||
aa_free_str_table(&pdb->trans);
|
||||
kfree(pdb);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user