2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-19 10:44:14 +08:00

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 <prarit@redhat.com>
Cc: Matthew Garrett <matthew.garrett@nebula.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
This commit is contained in:
Prarit Bhargava 2013-10-03 19:23:36 -04:00 committed by Matthew Garrett
parent ed12f295bf
commit a80e1053aa

View File

@ -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);