Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1c1365e3 authored by Vladimir Zapolskiy's avatar Vladimir Zapolskiy Committed by Greg Kroah-Hartman
Browse files

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: default avatarVladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4192c749
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -477,7 +477,6 @@ static int sysfs_bin_mmap(struct file *file, struct vm_area_struct *vma)
	if (!sysfs_get_active(of->sd))
	if (!sysfs_get_active(of->sd))
		goto out_unlock;
		goto out_unlock;


	rc = -EINVAL;
	if (!battr->mmap)
	if (!battr->mmap)
		goto out_put;
		goto out_put;