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

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

cxl: Fix error handling in _cxl_cx4_setup_msi_irqs()



'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 5cd4f5ce
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -538,7 +538,7 @@ int _cxl_cx4_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)

		if (remaining > 0) {
			new_ctx = cxl_dev_context_init(pdev);
			if (!new_ctx) {
			if (IS_ERR(new_ctx)) {
				pr_warn("%s: Failed to allocate enough contexts for MSIs\n", pci_name(pdev));
				return -ENOSPC;
			}