提交 1c1365e3 编写于 作者: V Vladimir Zapolskiy 提交者: Greg Kroah-Hartman

sysfs: return correct error code on unimplemented mmap()

Both POSIX.1-2008 and Linux Programmer's Manual have a dedicated return
error code for a case, when a file doesn't support mmap(), it's ENODEV.

This change replaces overloaded EINVAL with ENODEV in a situation
described above for sysfs binary files.
Signed-off-by: NVladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 4192c749
......@@ -477,7 +477,6 @@ static int sysfs_bin_mmap(struct file *file, struct vm_area_struct *vma)
if (!sysfs_get_active(of->sd))
goto out_unlock;
rc = -EINVAL;
if (!battr->mmap)
goto out_put;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册