From: Tejun Heo Date: Wed, 16 Jan 2008 03:06:14 +0000 (+0900) Subject: sysfs: make sysfs_lookup() return ERR_PTR(-ENOENT) on failed lookup X-Git-Tag: v2.6.24~62 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e49452c67703d3647467d65275fb893589384fed;p=pandora-kernel.git sysfs: make sysfs_lookup() return ERR_PTR(-ENOENT) on failed lookup sysfs tries to keep dcache a strict subset of sysfs_dirent tree by shooting down dentries when a node is removed, that is, no negative dentry for sysfs. However, the lookup function returned NULL and thus created negative dentries when the target node didn't exist. Make sysfs_lookup() return ERR_PTR(-ENOENT) on lookup failure. This fixes the NULL dereference bug in sysfs_get_dentry() discovered by bluetooth rfcomm device moving around. Signed-off-by: Tejun Heo Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed