summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPrarit Bhargava <prarit@redhat.com>2013-10-03 19:23:36 -0400
committerMatthew Garrett <matthew.garrett@nebula.com>2013-11-20 20:16:22 -0500
commita80e1053aaa395d94fff5ab7c73c89bb0c28c3c5 (patch)
tree7e71fecd4b28edf04ba16f19d60009199bd54881
parented12f295bfd5c378970106891f12999589aec4e5 (diff)
downloadlinux-a80e1053aaa395d94fff5ab7c73c89bb0c28c3c5.tar.bz2
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>
-rw-r--r--drivers/platform/x86/wmi.c6
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);