From: Prarit Bhargava Date: Thu, 3 Oct 2013 23:23:36 +0000 (-0400) Subject: x86, wmi fix modalias_show return values X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a80e1053aaa395d94fff5ab7c73c89bb0c28c3c5;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.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 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);