Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d518a44d authored by Dan Carpenter's avatar Dan Carpenter Committed by Doug Ledford
Browse files

IB/usnic: check for allocation failure



usnic_uiom_get_dev_list() can return ERR_PTR(-ENOMEM) so we should check
for that.

Fixes: e3cf00d0 ("IB/usnic: Add Cisco VIC low-level hardware driver")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarYuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 280ad49a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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));