* [PATCH net-next] net: axienet: move use of resource after validity check
@ 2019-06-11 16:56 Robert Hancock
2019-06-12 13:49 ` Andrew Lunn
2019-06-14 5:41 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Robert Hancock @ 2019-06-11 16:56 UTC (permalink / raw)
To: netdev; +Cc: anirudh, John.Linn, andrew, Robert Hancock
We were accessing the pointer returned from platform_get_resource before
checking if it was valid, causing an oops if it was not. Move this access
after the call to devm_ioremap_resource which does the validity check.
Signed-off-by: Robert Hancock <hancock@sedsystems.ca>
---
This bug was introduced in my recent axienet patch series and so is only
needed on net-next.
drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index da420c8..561e28a 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -1679,13 +1679,13 @@ static int axienet_probe(struct platform_device *pdev)
lp->tx_bd_num = TX_BD_NUM_DEFAULT;
/* Map device registers */
ethres = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- lp->regs_start = ethres->start;
lp->regs = devm_ioremap_resource(&pdev->dev, ethres);
if (IS_ERR(lp->regs)) {
dev_err(&pdev->dev, "could not map Axi Ethernet regs.\n");
ret = PTR_ERR(lp->regs);
goto free_netdev;
}
+ lp->regs_start = ethres->start;
/* Setup checksum offload, but default to off if not specified */
lp->features = 0;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: axienet: move use of resource after validity check
2019-06-11 16:56 [PATCH net-next] net: axienet: move use of resource after validity check Robert Hancock
@ 2019-06-12 13:49 ` Andrew Lunn
2019-06-14 5:41 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2019-06-12 13:49 UTC (permalink / raw)
To: Robert Hancock; +Cc: netdev, anirudh, John.Linn
On Tue, Jun 11, 2019 at 10:56:02AM -0600, Robert Hancock wrote:
> We were accessing the pointer returned from platform_get_resource before
> checking if it was valid, causing an oops if it was not. Move this access
> after the call to devm_ioremap_resource which does the validity check.
>
> Signed-off-by: Robert Hancock <hancock@sedsystems.ca>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: axienet: move use of resource after validity check
2019-06-11 16:56 [PATCH net-next] net: axienet: move use of resource after validity check Robert Hancock
2019-06-12 13:49 ` Andrew Lunn
@ 2019-06-14 5:41 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2019-06-14 5:41 UTC (permalink / raw)
To: hancock; +Cc: netdev, anirudh, John.Linn, andrew
From: Robert Hancock <hancock@sedsystems.ca>
Date: Tue, 11 Jun 2019 10:56:02 -0600
> We were accessing the pointer returned from platform_get_resource before
> checking if it was valid, causing an oops if it was not. Move this access
> after the call to devm_ioremap_resource which does the validity check.
>
> Signed-off-by: Robert Hancock <hancock@sedsystems.ca>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-06-14 5:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-11 16:56 [PATCH net-next] net: axienet: move use of resource after validity check Robert Hancock
2019-06-12 13:49 ` Andrew Lunn
2019-06-14 5:41 ` David Miller
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).