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


Groups > linux.kernel > #1512218 > unrolled thread

[PATCH] cxl: Fix error handling

Started byChristophe JAILLET <christophe.jaillet@wanadoo.fr>
First post2016-10-30 22:40 +0100
Last post2016-10-31 11:00 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] cxl: Fix error handling Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2016-10-30 22:40 +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 Michael Ellerman <mpe@ellerman.id.au> - 2016-10-31 11:00 +0100

#1512218 — [PATCH] cxl: Fix error handling

FromChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Date2016-10-30 22:40 +0100
Subject[PATCH] cxl: Fix error handling
Message-ID<sy5ZD-1Ct-5@gated-at.bofh.it>
'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/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

[toc] | [next] | [standalone]


#1512367

FromAndrew Donnellan <andrew.donnellan@au1.ibm.com>
Date2016-10-31 07:30 +0100
Message-ID<syegy-77I-9@gated-at.bofh.it>
In reply to#1512218
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 <christophe.jaillet@wanadoo.fr>

Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>

> ---
> 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

[toc] | [prev] | [next] | [standalone]


#1512436

FromMichael Ellerman <mpe@ellerman.id.au>
Date2016-10-31 11:00 +0100
Message-ID<syhxL-Bp-7@gated-at.bofh.it>
In reply to#1512367
Andrew Donnellan <andrew.donnellan@au1.ibm.com> writes:

> 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 <christophe.jaillet@wanadoo.fr>
>
> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
>
>> ---
>> 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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web