summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw
diff options
context:
space:
mode:
authorDan Carpenter2017-08-25 10:43:59 +0200
committerDoug Ledford2017-08-29 01:12:24 +0200
commitd518a44d317d92f4c297ea26a308b1ac1a980d33 (patch)
tree88cea46d5a535430a33dd2f614c2d1b826659216 /drivers/infiniband/hw
parentIB/hfi1: Add opcode states to qp_stats (diff)
downloadkernel-qcow2-linux-d518a44d317d92f4c297ea26a308b1ac1a980d33.tar.gz
kernel-qcow2-linux-d518a44d317d92f4c297ea26a308b1ac1a980d33.tar.xz
kernel-qcow2-linux-d518a44d317d92f4c297ea26a308b1ac1a980d33.zip
IB/usnic: check for allocation failure
usnic_uiom_get_dev_list() can return ERR_PTR(-ENOMEM) so we should check for that. Fixes: e3cf00d0a87f ("IB/usnic: Add Cisco VIC low-level hardware driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r--drivers/infiniband/hw/usnic/usnic_ib_verbs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/usnic/usnic_ib_verbs.c b/drivers/infiniband/hw/usnic/usnic_ib_verbs.c
index 97dd79ebb590..e4113ef09315 100644
--- a/drivers/infiniband/hw/usnic/usnic_ib_verbs.c
+++ b/drivers/infiniband/hw/usnic/usnic_ib_verbs.c
@@ -164,6 +164,8 @@ find_free_vf_and_create_qp_grp(struct usnic_ib_dev *us_ibdev,
if (usnic_ib_share_vf) {
/* Try to find resouces on a used vf which is in pd */
dev_list = usnic_uiom_get_dev_list(pd->umem_pd);
+ if (IS_ERR(dev_list))
+ return ERR_CAST(dev_list);
for (i = 0; dev_list[i]; i++) {
dev = dev_list[i];
vf = pci_get_drvdata(to_pci_dev(dev));