summaryrefslogtreecommitdiffstats
path: root/drivers/misc/cxl/phb.c
diff options
context:
space:
mode:
authorChristophe Jaillet <christophe.jaillet@wanadoo.fr>2016-10-30 22:40:47 +0100
committerMichael Ellerman <mpe@ellerman.id.au>2016-11-18 12:41:08 +0100
commitbb81733de28c99e10b61dcaff1592142abe53442 (patch)
treea96b49b1c3829bdc0bef0b3b7830de833500e936 /drivers/misc/cxl/phb.c
parentcxl: Fix error handling in _cxl_cx4_setup_msi_irqs() (diff)
downloadlinux-bb81733de28c99e10b61dcaff1592142abe53442.tar.xz
linux-bb81733de28c99e10b61dcaff1592142abe53442.zip
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: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Acked-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com> Acked-by: Ian Munsie <imunsie@au1.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'drivers/misc/cxl/phb.c')
-rw-r--r--drivers/misc/cxl/phb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/cxl/phb.c b/drivers/misc/cxl/phb.c
index 0935d44c1770..6ec69ada19f4 100644
--- a/drivers/misc/cxl/phb.c
+++ b/drivers/misc/cxl/phb.c
@@ -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;