Skip to content

Commit

Permalink
xen/pciback: fix XEN_PCI_OP_enable_msix result
Browse files Browse the repository at this point in the history
Prior to 2.6.19 and as of 2.6.31, pci_enable_msix() can return a
positive value to indicate the number of vectors (less than the amount
requested) that can be set up for a given device. Returning this as an
operation value (secondary result) is fine, but (primary) operation
results are expected to be negative (error) or zero (success) according
to the protocol. With the frontend fixed to match the XenoLinux
behavior, the backend can now validly return zero (success) here,
passing the upper limit on the number of vectors in op->value.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
  • Loading branch information
Jan Beulich authored and Konrad Rzeszutek Wilk committed Apr 6, 2012
1 parent e8c9e78 commit 0ee46ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/xen/xen-pciback/pciback_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ int xen_pcibk_enable_msix(struct xen_pcibk_device *pdev,
if (dev_data)
dev_data->ack_intr = 0;

return result;
return result > 0 ? 0 : result;
}

static
Expand Down

0 comments on commit 0ee46ec

Please sign in to comment.