public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sysfs: return correct error code on unimplemented mmap()
@ 2013-10-28 16:28 Vladimir Zapolskiy
  2013-10-28 16:35 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 6+ messages in thread
From: Vladimir Zapolskiy @ 2013-10-28 16:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman

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: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 fs/sysfs/bin.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/sysfs/bin.c b/fs/sysfs/bin.c
index c590cab..d37433c 100644
--- a/fs/sysfs/bin.c
+++ b/fs/sysfs/bin.c
@@ -350,7 +350,6 @@ static int mmap(struct file *file, struct vm_area_struct *vma)
 	if (!sysfs_get_active(attr_sd))
 		goto out_unlock;
 
-	rc = -EINVAL;
 	if (!attr->mmap)
 		goto out_put;
 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-10-30 14:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-28 16:28 [PATCH] sysfs: return correct error code on unimplemented mmap() Vladimir Zapolskiy
2013-10-28 16:35 ` Greg Kroah-Hartman
2013-10-28 17:22   ` Vladimir Zapolskiy
2013-10-29 23:05     ` Greg Kroah-Hartman
2013-10-30 12:08       ` [PATCH rebased] " Vladimir Zapolskiy
2013-10-30 14:50         ` Vladimir Zapolskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox