[PATCH] cxl: Fix error handling

Subsystems: char and misc drivers, the rest

STALE3575d

6 messages, 6 authors, 2016-11-22 · open the first message on its own page

[PATCH] cxl: Fix error handling

From: Christophe JAILLET <hidden>
Date: 2016-10-30 21:35:01

'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 <redacted>
---
un-compiled because I don't have the required  cross build environment.
---
 drivers/misc/cxl/api.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/cxl/api.c b/drivers/misc/cxl/api.c
index 2b88ad8a2a89..e2efc6489c6e 100644
--- a/drivers/misc/cxl/api.c
+++ b/drivers/misc/cxl/api.c
@@ -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;
 			}
-- 
2.9.3

Re: [PATCH] cxl: Fix error handling

From: Andrew Donnellan <hidden>
Date: 2016-10-31 06:27:19

On 31/10/16 08:34, Christophe JAILLET wrote:
'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 <redacted>
Reviewed-by: Andrew Donnellan <redacted>
---
un-compiled because I don't have the required  cross build environment.
Builds fine here.

In future, you might want to bundle all 3 of your patches either into 1 
patch (while they are changes which can be done separately, it's all 
fixes to one type of problem in relation to one function, so personally 
I'm okay with that) or send it as a series, so that it's clear to 
everyone that they're all related fixes.

Additionally, having the same patch subject line for two patches sent in 
short succession is a bit confusing - in future, try and avoid that.


Andrew

-- 
Andrew Donnellan              OzLabs, ADL Canberra
andrew.donnellan@au1.ibm.com  IBM Australia Limited

Re: [PATCH] cxl: Fix error handling

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2016-10-31 09:50:20

Andrew Donnellan [off-list ref] writes:
On 31/10/16 08:34, Christophe JAILLET wrote:
quoted
'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 <redacted>
Reviewed-by: Andrew Donnellan <redacted>
quoted
---
un-compiled because I don't have the required  cross build environment.
Builds fine here.

In future, you might want to bundle all 3 of your patches either into 1 
patch (while they are changes which can be done separately, it's all 
fixes to one type of problem in relation to one function, so personally 
I'm okay with that) or send it as a series, so that it's clear to 
everyone that they're all related fixes.
Additionally, having the same patch subject line for two patches sent in 
short succession is a bit confusing - in future, try and avoid that.
Yeah. I actually assumed it was two versions of the same patch.

cheers

Re: [PATCH] cxl: Fix error handling

From: Frederic Barrat <hidden>
Date: 2016-11-02 16:46:31


Le 30/10/2016 à 22:34, Christophe JAILLET a écrit :
'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 <redacted>

Acked-by: Frederic Barrat <redacted>

Re: [PATCH] cxl: Fix error handling

From: Ian Munsie <hidden>
Date: 2016-11-16 01:54:44

Acked-by: Ian Munsie <redacted>

Re: cxl: Fix error handling

From: Michael Ellerman <hidden>
Date: 2016-11-22 00:34:22

On Sun, 2016-10-30 at 21:34:51 UTC, Christophe Jaillet wrote:
'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 <redacted>
Reviewed-by: Andrew Donnellan <redacted>
Acked-by: Frederic Barrat <redacted>
Acked-by: Ian Munsie <redacted>
Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/28e323e5a0b21b3665eb6e136ca8bb

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help