Skip to contentSkip to conversation

x86, wmi fix modalias_show return values

PATCH Applied Prarit Bhargava 2 participants 2 messages Oct 3, 2013 – Nov 20, 2013 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/platform/x86/wmi.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/platform/x86/wmi.c +4 -2
index 601ea95..6170b64 100644
@@ -686,8 +686,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);
 
Signature · 1 line
1.7.9.3