[lkml]   [2013]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] 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: Vladimir Zapolskiy <>
Cc: Greg Kroah-Hartman <>
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;


 \ /
  Last update: 2013-10-28 17:41    [W:0.077 / U:2.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site