diff options
author | Frank Haverkamp <haver@linux.vnet.ibm.com> | 2014-09-10 10:37:50 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-24 02:15:46 -0400 |
commit | bc407dd319bb8c3608369989d95b700d00e6cf43 (patch) | |
tree | fa58685cb2537f921c09ac2661cc172d8b5c59f1 /drivers/misc/genwqe | |
parent | 2d880ccfa9be92a10ea19f5a8f7e4be2a7d45e4d (diff) |
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/misc/genwqe')
-rw-r--r-- | drivers/misc/genwqe/card_base.c | 5 |
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) | |||
1320 | 1320 | ||
1321 | static int genwqe_sriov_configure(struct pci_dev *dev, int numvfs) | 1321 | static int genwqe_sriov_configure(struct pci_dev *dev, int numvfs) |
1322 | { | 1322 | { |
1323 | int rc; | ||
1323 | struct genwqe_dev *cd = dev_get_drvdata(&dev->dev); | 1324 | struct genwqe_dev *cd = dev_get_drvdata(&dev->dev); |
1324 | 1325 | ||
1325 | if (numvfs > 0) { | 1326 | if (numvfs > 0) { |
1326 | genwqe_setup_vf_jtimer(cd); | 1327 | genwqe_setup_vf_jtimer(cd); |
1327 | pci_enable_sriov(dev, numvfs); | 1328 | rc = pci_enable_sriov(dev, numvfs); |
1329 | if (rc < 0) | ||
1330 | return rc; | ||
1328 | return numvfs; | 1331 | return numvfs; |
1329 | } | 1332 | } |
1330 | if (numvfs == 0) { | 1333 | if (numvfs == 0) { |