提交 447c5dd7 编写于 作者: M Michal Schmidt 提交者: Jesse Barnes

PCI: return correct value when writing to the "reset" attribute

A successful write() to the "reset" sysfs attribute should return the
number of bytes written, not 0. Otherwise userspace (bash) retries the
write over and over again.
Acked-by: NMichael S. Tsirkin <mst@redhat.com>
Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: NMichal Schmidt <mschmidt@redhat.com>
Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
上级 3196180a
...@@ -960,7 +960,12 @@ static ssize_t reset_store(struct device *dev, ...@@ -960,7 +960,12 @@ static ssize_t reset_store(struct device *dev,
if (val != 1) if (val != 1)
return -EINVAL; return -EINVAL;
return pci_reset_function(pdev);
result = pci_reset_function(pdev);
if (result < 0)
return result;
return count;
} }
static struct device_attribute reset_attr = __ATTR(reset, 0200, NULL, reset_store); static struct device_attribute reset_attr = __ATTR(reset, 0200, NULL, reset_store);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册