summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorFrank Haverkamp <haver@linux.vnet.ibm.com>2014-09-10 16:37:50 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-09-24 08:15:46 +0200
commitbc407dd319bb8c3608369989d95b700d00e6cf43 (patch)
treefa58685cb2537f921c09ac2661cc172d8b5c59f1 /drivers
parentGenWQE: Do not modify return code of genwqe_set_interrupt_capability (diff)
downloadlinux-bc407dd319bb8c3608369989d95b700d00e6cf43.tar.xz
linux-bc407dd319bb8c3608369989d95b700d00e6cf43.zip
GenWQE: Check return code of pci_sriov_enable
Forgetting to check this, can lead to problems on systems which do not support SRIOV. Signed-off-by: Frank Haverkamp <haver@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/misc/genwqe/card_base.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/misc/genwqe/card_base.c b/drivers/misc/genwqe/card_base.c
index 12926c8c0609..16672d9e1e0c 100644
--- a/drivers/misc/genwqe/card_base.c
+++ b/drivers/misc/genwqe/card_base.c
@@ -1320,11 +1320,14 @@ static void genwqe_err_resume(struct pci_dev *pci_dev)
static int genwqe_sriov_configure(struct pci_dev *dev, int numvfs)
{
+ int rc;
struct genwqe_dev *cd = dev_get_drvdata(&dev->dev);
if (numvfs > 0) {
genwqe_setup_vf_jtimer(cd);
- pci_enable_sriov(dev, numvfs);
+ rc = pci_enable_sriov(dev, numvfs);
+ if (rc < 0)
+ return rc;
return numvfs;
}
if (numvfs == 0) {