* [PATCH -next] irqchip/ompic: fix return value check in ompic_of_init()
@ 2018-01-02 11:47 Wei Yongjun
2018-01-03 14:41 ` Stafford Horne
0 siblings, 1 reply; 4+ messages in thread
From: Wei Yongjun @ 2018-01-02 11:47 UTC (permalink / raw)
To: Jonas Bonn, Stefan Kristiansson, Stafford Horne, Thomas Gleixner,
Jason Cooper, Marc Zyngier
Cc: Wei Yongjun, openrisc, linux-kernel
In case of error, the function ioremap() returns NULL pointer not
ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.
Fixes: 9b54470afd83 ("irqchip: add initial support for ompic")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/irqchip/irq-ompic.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/irqchip/irq-ompic.c b/drivers/irqchip/irq-ompic.c
index cf6d0c4..400b119 100644
--- a/drivers/irqchip/irq-ompic.c
+++ b/drivers/irqchip/irq-ompic.c
@@ -171,9 +171,9 @@ static int __init ompic_of_init(struct device_node *node,
/* Setup the device */
ompic_base = ioremap(res.start, resource_size(&res));
- if (IS_ERR(ompic_base)) {
+ if (!ompic_base) {
pr_err("ompic: unable to map registers");
- return PTR_ERR(ompic_base);
+ return -ENOMEM;
}
irq = irq_of_parse_and_map(node, 0);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -next] irqchip/ompic: fix return value check in ompic_of_init()
2018-01-02 11:47 [PATCH -next] irqchip/ompic: fix return value check in ompic_of_init() Wei Yongjun
@ 2018-01-03 14:41 ` Stafford Horne
2018-01-04 3:56 ` weiyongjun (A)
0 siblings, 1 reply; 4+ messages in thread
From: Stafford Horne @ 2018-01-03 14:41 UTC (permalink / raw)
To: Wei Yongjun
Cc: Jonas Bonn, Stefan Kristiansson, Thomas Gleixner, Jason Cooper,
Marc Zyngier, openrisc, linux-kernel
On Tue, Jan 02, 2018 at 11:47:19AM +0000, Wei Yongjun wrote:
> In case of error, the function ioremap() returns NULL pointer not
> ERR_PTR(). The IS_ERR() test in the return value check should be
> replaced with NULL test.
Thanks, I am not sure why I was using the *ERR*() macros. 2 questions:
- How did you notice this?
- Should I pull this in through my tree or do you have another route? i.e.
Marc?
> Fixes: 9b54470afd83 ("irqchip: add initial support for ompic")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Stafford Horne <shorne@gmail.com>
-Stafford
> ---
> drivers/irqchip/irq-ompic.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/irqchip/irq-ompic.c b/drivers/irqchip/irq-ompic.c
> index cf6d0c4..400b119 100644
> --- a/drivers/irqchip/irq-ompic.c
> +++ b/drivers/irqchip/irq-ompic.c
> @@ -171,9 +171,9 @@ static int __init ompic_of_init(struct device_node *node,
>
> /* Setup the device */
> ompic_base = ioremap(res.start, resource_size(&res));
> - if (IS_ERR(ompic_base)) {
> + if (!ompic_base) {
> pr_err("ompic: unable to map registers");
> - return PTR_ERR(ompic_base);
> + return -ENOMEM;
> }
>
> irq = irq_of_parse_and_map(node, 0);
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH -next] irqchip/ompic: fix return value check in ompic_of_init()
2018-01-03 14:41 ` Stafford Horne
@ 2018-01-04 3:56 ` weiyongjun (A)
2018-01-04 9:57 ` Marc Zyngier
0 siblings, 1 reply; 4+ messages in thread
From: weiyongjun (A) @ 2018-01-04 3:56 UTC (permalink / raw)
To: Stafford Horne
Cc: Jonas Bonn, Stefan Kristiansson, Thomas Gleixner, Jason Cooper,
Marc Zyngier, openrisc, linux-kernel
On Wed, Jan 03, 2018 10:41 PM, Stafford Horne wrote:
> On Tue, Jan 02, 2018 at 11:47:19AM +0000, Wei Yongjun wrote:
> > In case of error, the function ioremap() returns NULL pointer not
> > ERR_PTR(). The IS_ERR() test in the return value check should be
> > replaced with NULL test.
>
> Thanks, I am not sure why I was using the *ERR*() macros. 2 questions:
>
> - How did you notice this?
This is detected by Coccinelle semantic patch.
> - Should I pull this in through my tree or do you have another route? i.e.
> Marc?
Feel free to pull this through your tree.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -next] irqchip/ompic: fix return value check in ompic_of_init()
2018-01-04 3:56 ` weiyongjun (A)
@ 2018-01-04 9:57 ` Marc Zyngier
0 siblings, 0 replies; 4+ messages in thread
From: Marc Zyngier @ 2018-01-04 9:57 UTC (permalink / raw)
To: weiyongjun (A), Stafford Horne
Cc: Jonas Bonn, Stefan Kristiansson, Thomas Gleixner, Jason Cooper,
openrisc, linux-kernel
On 04/01/18 03:56, weiyongjun (A) wrote:
> On Wed, Jan 03, 2018 10:41 PM, Stafford Horne wrote:
>> On Tue, Jan 02, 2018 at 11:47:19AM +0000, Wei Yongjun wrote:
>>> In case of error, the function ioremap() returns NULL pointer not
>>> ERR_PTR(). The IS_ERR() test in the return value check should be
>>> replaced with NULL test.
>>
>> Thanks, I am not sure why I was using the *ERR*() macros. 2 questions:
>>
>> - How did you notice this?
>
> This is detected by Coccinelle semantic patch.
>
>> - Should I pull this in through my tree or do you have another route? i.e.
>> Marc?
>
> Feel free to pull this through your tree.
That's for me to say... I'll take it.
Thanks,
M.
--
Jazz is not dead. It just smells funny...
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-01-04 9:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-02 11:47 [PATCH -next] irqchip/ompic: fix return value check in ompic_of_init() Wei Yongjun
2018-01-03 14:41 ` Stafford Horne
2018-01-04 3:56 ` weiyongjun (A)
2018-01-04 9:57 ` Marc Zyngier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®