apparmor: Remove unnecessary NULL check before kvfree()
Subsystems (2)
PATCH RESEND 1/1 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]>
--- security/apparmor/policy.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
security/apparmor/policy.c +1 -2
@@ -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); }
Signature · 1 line
2.47.0