diff options
author | Prarit Bhargava <prarit@redhat.com> | 2013-10-03 19:23:36 -0400 |
---|---|---|
committer | Matthew Garrett <matthew.garrett@nebula.com> | 2013-11-20 20:16:22 -0500 |
commit | a80e1053aaa395d94fff5ab7c73c89bb0c28c3c5 (patch) | |
tree | 7e71fecd4b28edf04ba16f19d60009199bd54881 /drivers/platform/x86/wmi.c | |
parent | ed12f295bfd5c378970106891f12999589aec4e5 (diff) |
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/wmi.c')
-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, | |||
672 | struct wmi_block *wblock; | 672 | struct wmi_block *wblock; |
673 | 673 | ||
674 | wblock = dev_get_drvdata(dev); | 674 | wblock = dev_get_drvdata(dev); |
675 | if (!wblock) | 675 | if (!wblock) { |
676 | return -ENOMEM; | 676 | strcat(buf, "\n"); |
677 | return strlen(buf); | ||
678 | } | ||
677 | 679 | ||
678 | wmi_gtoa(wblock->gblock.guid, guid_string); | 680 | wmi_gtoa(wblock->gblock.guid, guid_string); |
679 | 681 | ||