X86 platform drivers
 help / color / mirror / Atom feed
* [PATCH] x86, wmi fix modalias_show return values
@ 2013-10-03 23:23 Prarit Bhargava
  2013-11-20 23:52 ` Matthew Garrett
  0 siblings, 1 reply; 2+ messages in thread
From: Prarit Bhargava @ 2013-10-03 23:23 UTC (permalink / raw)
  To: platform-driver-x86; +Cc: Prarit Bhargava, Matthew Garrett

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>
---
 drivers/platform/x86/wmi.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index 601ea95..6170b64 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -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);
 
-- 
1.7.9.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] x86, wmi fix modalias_show return values
  2013-10-03 23:23 [PATCH] x86, wmi fix modalias_show return values Prarit Bhargava
@ 2013-11-20 23:52 ` Matthew Garrett
  0 siblings, 0 replies; 2+ messages in thread
From: Matthew Garrett @ 2013-11-20 23:52 UTC (permalink / raw)
  To: prarit@redhat.com; +Cc: platform-driver-x86@vger.kernel.org

Applied, thanks.

-- 
Matthew Garrett <matthew.garrett@nebula.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-20 23:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-03 23:23 [PATCH] x86, wmi fix modalias_show return values Prarit Bhargava
2013-11-20 23:52 ` Matthew Garrett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox