]> git.baikalelectronics.ru Git - kernel.git/commit
Smack: freeing an error pointer in smk_write_revoke_subj()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 11 Jun 2015 08:51:16 +0000 (11:51 +0300)
committerCasey Schaufler <casey@schaufler-ca.com>
Fri, 12 Jun 2015 18:59:11 +0000 (11:59 -0700)
commit16b0dd1d8a5756f782154308099eb7faeffc9c0a
tree88bb712ff5231e78e43f9d7a4c63f2bf2d1f8be2
parent95ac4fc39ba4d4fba6cf3f79368dbf659e51356c
Smack: freeing an error pointer in smk_write_revoke_subj()

This code used to rely on the fact that kfree(NULL) was a no-op, but
then we changed smk_parse_smack() to return error pointers on failure
instead of NULL.  Calling kfree() on an error pointer will oops.

I have re-arranged things a bit so that we only free things if they
have been allocated.

Fixes: de65f9b48a7c ('smack: pass error code through pointers')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
security/smack/smackfs.c