diff options
author | Prarit Bhargava <prarit@redhat.com> | 2013-10-04 01:23:36 +0200 |
---|---|---|
committer | Matthew Garrett <matthew.garrett@nebula.com> | 2013-11-21 02:16:22 +0100 |
commit | a80e1053aaa395d94fff5ab7c73c89bb0c28c3c5 (patch) | |
tree | 7e71fecd4b28edf04ba16f19d60009199bd54881 /drivers/platform/x86 | |
parent | ipc: Added support for IPC interrupt mode (diff) | |
download | linux-a80e1053aaa395d94fff5ab7c73c89bb0c28c3c5.tar.xz linux-a80e1053aaa395d94fff5ab7c73c89bb0c28c3c5.zip |
x86, wmi fix modalias_show return values
I just fixed this same bug in arch/powerpc/kernel/vio.c and took a quick
look for other similar errors in the kernel.
modalias_show() should return an empty string on error, not errno.
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Cc: Matthew Garrett <matthew.garrett@nebula.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Diffstat (limited to 'drivers/platform/x86')
-rw-r--r-- | drivers/platform/x86/wmi.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index 62e8c221d01e..c2e7b2657aeb 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c @@ -672,8 +672,10 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, struct wmi_block *wblock; wblock = dev_get_drvdata(dev); - if (!wblock) - return -ENOMEM; + if (!wblock) { + strcat(buf, "\n"); + return strlen(buf); + } wmi_gtoa(wblock->gblock.guid, guid_string); |