From: Prarit Bhargava Date: Thu, 3 Oct 2013 23:23:36 +0000 (-0400) Subject: x86, wmi fix modalias_show return values X-Git-Tag: v4.9.8~7371^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a80e1053aaa395d94fff5ab7c73c89bb0c28c3c5;p=platform%2Fkernel%2Flinux-rpi3.git 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 Cc: Matthew Garrett Signed-off-by: Matthew Garrett --- 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);