securityfs: Drop dentry reference count when mknod fails
authorTvrtko Ursulin <tvrtko.ursulin@sophos.com>
Thu, 15 Jul 2010 12:25:06 +0000 (13:25 +0100)
committerJames Morris <jmorris@namei.org>
Mon, 2 Aug 2010 05:34:59 +0000 (15:34 +1000)
commitb8bc83ab4dcbc9938b95a90bbb50d89d1904d5ab
tree7ccdfa1ad932b8556052aa0de65d017816a4470e
parent57a62c2317d60b21b7761c319a733a894482a6af
securityfs: Drop dentry reference count when mknod fails

lookup_one_len increments dentry reference count which is not decremented
when the create operation fails. This can cause a kernel BUG at
fs/dcache.c:676 at unmount time. Also error code returned when new_inode()
fails was replaced with more appropriate -ENOMEM.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@sophos.com>
Acked-by: Serge E. Hallyn <serge@hallyn.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: James Morris <jmorris@namei.org>
security/inode.c