mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-14 17:14:09 +00:00
ae2108ad32
Currently the kobject based interface guarantees that a parent sysfs_dirent is always a directory; however, the planned kernfs interface will be directly based on sysfs_dirents and the caller may specify non-directory node as the parent. Add an explicit check in __sysfs_add_one() so that such attempts fail with -EINVAL. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>