diff options
author | Prarit Bhargava <prarit@redhat.com> | 2013-10-03 23:23:36 (GMT) |
---|---|---|
committer | Matthew Garrett <matthew.garrett@nebula.com> | 2013-11-21 01:16:22 (GMT) |
commit | a80e1053aaa395d94fff5ab7c73c89bb0c28c3c5 (patch) | |
tree | 7e71fecd4b28edf04ba16f19d60009199bd54881 /drivers/platform | |
parent | ed12f295bfd5c378970106891f12999589aec4e5 (diff) | |
download | linux-a80e1053aaa395d94fff5ab7c73c89bb0c28c3c5.tar.xz |
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')
-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 62e8c22..c2e7b26 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); |