Skip to content

Commit

Permalink
x86, wmi fix modalias_show return values
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Prarit Bhargava authored and Matthew Garrett committed Nov 21, 2013
1 parent ed12f29 commit a80e105
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/platform/x86/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit a80e105

Please sign in to comment.