提交 a80e1053 编写于 作者: P Prarit Bhargava 提交者: Matthew Garrett

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: NPrarit Bhargava <prarit@redhat.com>
Cc: Matthew Garrett <matthew.garrett@nebula.com>
Signed-off-by: NMatthew Garrett <matthew.garrett@nebula.com>
上级 ed12f295
...@@ -672,8 +672,10 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, ...@@ -672,8 +672,10 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
struct wmi_block *wblock; struct wmi_block *wblock;
wblock = dev_get_drvdata(dev); wblock = dev_get_drvdata(dev);
if (!wblock) if (!wblock) {
return -ENOMEM; strcat(buf, "\n");
return strlen(buf);
}
wmi_gtoa(wblock->gblock.guid, guid_string); wmi_gtoa(wblock->gblock.guid, guid_string);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册