base: memory: fix soft/hard_offline_page permissions
authorFelipe Balbi <balbi@ti.com>
Mon, 18 Feb 2013 19:09:03 +0000 (21:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 18 Feb 2013 19:18:13 +0000 (11:18 -0800)
those two sysfs files don't have a 'show' method,
so they shouldn't have a read permission. Thanks
to Greg Kroah-Hartman for actually looking into
the source code and figuring out we had a real bug
with these two files.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/memory.c

index 987604d56c83009cf94c63235d10841bdbf5bd94..83d0b17ba1c20231d51a248224996cfefbdabcc6 100644 (file)
@@ -494,8 +494,8 @@ store_hard_offline_page(struct device *dev,
        return ret ? ret : count;
 }
 
-static DEVICE_ATTR(soft_offline_page, 0644, NULL, store_soft_offline_page);
-static DEVICE_ATTR(hard_offline_page, 0644, NULL, store_hard_offline_page);
+static DEVICE_ATTR(soft_offline_page, S_IWUSR, NULL, store_soft_offline_page);
+static DEVICE_ATTR(hard_offline_page, S_IWUSR, NULL, store_hard_offline_page);
 
 static __init int memory_fail_init(void)
 {