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

Commit bb81733d authored by Christophe Jaillet's avatar Christophe Jaillet Committed by Michael Ellerman
Browse files

cxl: Fix error handling in _cxl_pci_associate_default_context()



'cxl_dev_context_init()' returns an error pointer in case of error, not
NULL. So test it with IS_ERR.

Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: default avatarAndrew Donnellan <andrew.donnellan@au1.ibm.com>
Acked-by: default avatarFrederic Barrat <fbarrat@linux.vnet.ibm.com>
Acked-by: default avatarIan Munsie <imunsie@au1.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 28e323e5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1921,7 +1921,7 @@ static pci_ers_result_t cxl_pci_slot_reset(struct pci_dev *pdev)
				goto err;

			ctx = cxl_dev_context_init(afu_dev);
			if (!ctx)
			if (IS_ERR(ctx))
				goto err;

			afu_dev->dev.archdata.cxl_ctx = ctx;
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ bool _cxl_pci_associate_default_context(struct pci_dev *dev, struct cxl_afu *afu
	 * in the virtual phb, we'll need a default context to attach them to.
	 */
	ctx = cxl_dev_context_init(dev);
	if (!ctx)
	if (IS_ERR(ctx))
		return false;
	dev->dev.archdata.cxl_ctx = ctx;