Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1512219

[PATCH] cxl: Fix error handling

From Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Newsgroups linux.kernel
Subject [PATCH] cxl: Fix error handling
Date 2016-10-30 22:50 +0100
Message-ID <sy69k-1FQ-11@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


'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>
---
un-compiled because I don't have the required  cross build environment.
---
 drivers/misc/cxl/pci.c | 2 +-
 drivers/misc/cxl/phb.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c
index e96be9ca4e60..80a87ab25b83 100644
--- a/drivers/misc/cxl/pci.c
+++ b/drivers/misc/cxl/pci.c
@@ -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;
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;
 
-- 
2.9.3

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] cxl: Fix error handling Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2016-10-30 22:50 +0100
  Re: [PATCH] cxl: Fix error handling Michael Ellerman <mpe@ellerman.id.au> - 2016-10-31 06:40 +0100
    Re: [PATCH] cxl: Fix error handling Jim Davis <jim.epost@gmail.com> - 2016-11-02 00:40 +0100
      Re: [PATCH] cxl: Fix error handling Michael Ellerman <mpe@ellerman.id.au> - 2016-11-02 12:20 +0100
        Re: [PATCH] cxl: Fix error handling Jim Davis <jim.epost@gmail.com> - 2016-11-02 20:10 +0100
          Re: [PATCH] cxl: Fix error handling Michael Ellerman <mpe@ellerman.id.au> - 2016-11-03 11:00 +0100
  Re: [PATCH] cxl: Fix error handling Andrew Donnellan <andrew.donnellan@au1.ibm.com> - 2016-10-31 07:30 +0100
  Re: [PATCH] cxl: Fix error handling Frederic Barrat <fbarrat@linux.vnet.ibm.com> - 2016-11-02 18:00 +0100

csiph-web