* [PATCH] net: ethernet: ixp4xx: Add error handling in ixp4xx_eth_probe()
@ 2020-04-12 9:27 Tang Bin
2020-04-12 18:35 ` Jakub Kicinski
0 siblings, 1 reply; 5+ messages in thread
From: Tang Bin @ 2020-04-12 9:27 UTC (permalink / raw)
To: khalasa, davem; +Cc: netdev, linux-kernel, Tang Bin, Shengju Zhang
The function ixp4xx_eth_probe() does not perform sufficient error
checking after executing devm_ioremap_resource(),which can result
in crashes if a critical error path is encountered.
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Signed-off-by: Shengju Zhang <zhangshengju@cmss.chinamobile.com>
---
drivers/net/ethernet/xscale/ixp4xx_eth.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c
index 269596c15..2e5202923 100644
--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c
+++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c
@@ -1387,6 +1387,8 @@ static int ixp4xx_eth_probe(struct platform_device *pdev)
return -ENODEV;
regs_phys = res->start;
port->regs = devm_ioremap_resource(dev, res);
+ if (IS_ERR(port->regs))
+ return PTR_ERR(port->regs);
switch (port->id) {
case IXP4XX_ETH_NPEA:
--
2.20.1.windows.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] net: ethernet: ixp4xx: Add error handling in ixp4xx_eth_probe()
2020-04-12 9:27 [PATCH] net: ethernet: ixp4xx: Add error handling in ixp4xx_eth_probe() Tang Bin
@ 2020-04-12 18:35 ` Jakub Kicinski
2020-04-13 10:59 ` [PATCH] net: ethernet: ixp4xx: Add error handling inixp4xx_eth_probe() Tang Bin
2020-04-21 4:46 ` Tang Bin
0 siblings, 2 replies; 5+ messages in thread
From: Jakub Kicinski @ 2020-04-12 18:35 UTC (permalink / raw)
To: Tang Bin; +Cc: khalasa, davem, netdev, linux-kernel, Shengju Zhang
On Sun, 12 Apr 2020 17:27:28 +0800 Tang Bin wrote:
> The function ixp4xx_eth_probe() does not perform sufficient error
> checking after executing devm_ioremap_resource(),which can result
> in crashes if a critical error path is encountered.
>
> Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
> Signed-off-by: Shengju Zhang <zhangshengju@cmss.chinamobile.com>
Please provide an appropriate Fixes: tag.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] net: ethernet: ixp4xx: Add error handling inixp4xx_eth_probe()
2020-04-12 18:35 ` Jakub Kicinski
@ 2020-04-13 10:59 ` Tang Bin
2020-04-21 4:46 ` Tang Bin
1 sibling, 0 replies; 5+ messages in thread
From: Tang Bin @ 2020-04-13 10:59 UTC (permalink / raw)
To: Jakub Kicinski; +Cc: khalasa, davem, netdev, linux-kernel
Hi:
On 2020/4/13 2:35, Jakub Kicinski wrote:
> Please provide an appropriate Fixes: tag.
Should be:
Fixes: f458ac47 ("ARM/net: ixp4xx: Pass ethernet physical base as
resource").
Thanks,
Tang Bin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] net: ethernet: ixp4xx: Add error handling inixp4xx_eth_probe()
2020-04-12 18:35 ` Jakub Kicinski
2020-04-13 10:59 ` [PATCH] net: ethernet: ixp4xx: Add error handling inixp4xx_eth_probe() Tang Bin
@ 2020-04-21 4:46 ` Tang Bin
2020-04-21 17:05 ` Jakub Kicinski
1 sibling, 1 reply; 5+ messages in thread
From: Tang Bin @ 2020-04-21 4:46 UTC (permalink / raw)
To: Jakub Kicinski; +Cc: khalasa, davem, netdev, linux-kernel, Shengju Zhang
Hi Jakub:
On 2020/4/13 2:35, Jakub Kicinski wrote:
> On Sun, 12 Apr 2020 17:27:28 +0800 Tang Bin wrote:
>> The function ixp4xx_eth_probe() does not perform sufficient error
>> checking after executing devm_ioremap_resource(),which can result
>> in crashes if a critical error path is encountered.
>>
> Please provide an appropriate Fixes: tag.
Thanks for your reply.
I don't know whether the commit message affect this patch's result. If so,
I think the commit message in v2 needs more clarification. As follows:
The function ixp4xx_eth_probe() does not perform sufficient error
checking
after executing devm_ioremap_resource(), which can result in crashes if
a critical
error path is encountered.
Fixes: f458ac479777 ("ARM/net: ixp4xx: Pass ethernet physical base
as resource").
I'm waiting for you reply actively.
Thanks,
Tang Bin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] net: ethernet: ixp4xx: Add error handling inixp4xx_eth_probe()
2020-04-21 4:46 ` Tang Bin
@ 2020-04-21 17:05 ` Jakub Kicinski
0 siblings, 0 replies; 5+ messages in thread
From: Jakub Kicinski @ 2020-04-21 17:05 UTC (permalink / raw)
To: Tang Bin; +Cc: khalasa, davem, netdev, linux-kernel, Shengju Zhang
On Tue, 21 Apr 2020 12:46:37 +0800 Tang Bin wrote:
> Hi Jakub:
>
> On 2020/4/13 2:35, Jakub Kicinski wrote:
> > On Sun, 12 Apr 2020 17:27:28 +0800 Tang Bin wrote:
> >> The function ixp4xx_eth_probe() does not perform sufficient error
> >> checking after executing devm_ioremap_resource(),which can result
> >> in crashes if a critical error path is encountered.
> >>
> > Please provide an appropriate Fixes: tag.
>
> Thanks for your reply.
>
> I don't know whether the commit message affect this patch's result. If so,
>
> I think the commit message in v2 needs more clarification. As follows:
>
> The function ixp4xx_eth_probe() does not perform sufficient error
> checking
>
> after executing devm_ioremap_resource(), which can result in crashes if
> a critical
>
> error path is encountered.
>
> Fixes: f458ac479777 ("ARM/net: ixp4xx: Pass ethernet physical base
> as resource").
>
>
> I'm waiting for you reply actively.
Please repost with the tag included.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-04-21 17:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-12 9:27 [PATCH] net: ethernet: ixp4xx: Add error handling in ixp4xx_eth_probe() Tang Bin
2020-04-12 18:35 ` Jakub Kicinski
2020-04-13 10:59 ` [PATCH] net: ethernet: ixp4xx: Add error handling inixp4xx_eth_probe() Tang Bin
2020-04-21 4:46 ` Tang Bin
2020-04-21 17:05 ` Jakub Kicinski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).