Skip to contentSkip to conversation

net: ll_temac: platform_get_resource replaced by wrong function

PATCH Superseded Claus Hansen Ries 5 participants 6 messages Mar 20, 2024 – Mar 26, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net: ll_temac: platform_get_resource replaced by wrong function

From: Claus Hansen Ries <[email protected]>

Hope I am resubmitting this correctly, I've fixed the issues in the original submission.

platform_get_resource was replaced with devm_platform_ioremap_resource_byname and is called using 0 as name. This eventually ends up in platform_get_resource_byname in the call stack, where it causes a null pointer in strcmp.

	if (type == resource_type(r) && !strcmp(r->name, name))

It should have been replaced with devm_platform_ioremap_resource.

Fixes bd69058f50d5 ("net: ll_temac: Use devm_platform_ioremap_resource_byname()")

---
v2:
- fix accidently converting tabs to spaces and wording in commit message
v1: https://marc.info/?l=linux-netdev&m=171087828129633&w=2

 drivers/net/ethernet/xilinx/ll_temac_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/xilinx/ll_temac_main.c +1 -1
index 9df39cf8b097..1072e2210aed 100644
@@ -1443,7 +1443,7 @@ static int temac_probe(struct platform_device *pdev)
 	}
 
 	/* map device registers */
-	lp->regs = devm_platform_ioremap_resource_byname(pdev, 0);
+	lp->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(lp->regs)) {
 		dev_err(&pdev->dev, "could not map TEMAC registers\n");
 		return -ENOMEM;

base-commit: d95fcdf4961d27a3d17e5c7728367197adc89b8d

Signature · 9 lines
2.39.3 (Apple Git-146)




_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
reviewer Reviewed-by on v2 1/1
#1 lore raw
Quoted 4 lines · Claus Hansen Ries

From: Claus Hansen Ries <[email protected]>

Hope I am resubmitting this correctly, I've fixed the issues in the original submission.

For future reference, the text above probably belongs below the scissors ("---"). But I don't think there is a need to resubmit just because of that.

Quoted 9 lines

platform_get_resource was replaced with devm_platform_ioremap_resource_byname and is called using 0 as name. This eventually ends up in platform_get_resource_byname in the call stack, where it causes a null pointer in strcmp.

	if (type == resource_type(r) && !strcmp(r->name, name))

It should have been replaced with devm_platform_ioremap_resource.

Quoted 7 lines
Fixes bd69058f50d5 ("net: ll_temac: Use devm_platform_ioremap_resource_byname()")

---
v2:
- fix accidently converting tabs to spaces and wording in commit message
v1: https://marc.info/?l=linux-netdev&m=171087828129633&w=2

Thanks,

#2 lore raw
Quoted 9 lines · Wed, Mar 20, 2024 at 04:22:46PM CET, [email protected] wrote:
Quoted 4 lines · Claus Hansen Ries

From: Claus Hansen Ries <[email protected]>

Hope I am resubmitting this correctly, I've fixed the issues in the original submission.

For future reference, the text above probably belongs below the scissors ("---"). But I don't think there is a need to resubmit just because of that.

Well, otherwise this will be in the git history forever :)

Quoted 22 lines
Quoted 10 lines

platform_get_resource was replaced with devm_platform_ioremap_resource_byname and is called using 0 as name. This eventually ends up in platform_get_resource_byname in the call stack, where it causes a null pointer in strcmp.

	if (type == resource_type(r) && !strcmp(r->name, name))

It should have been replaced with devm_platform_ioremap_resource.

Quoted 7 lines
Fixes bd69058f50d5 ("net: ll_temac: Use devm_platform_ioremap_resource_byname()")

---
v2:
- fix accidently converting tabs to spaces and wording in commit message
v1: https://marc.info/?l=linux-netdev&m=171087828129633&w=2

Thanks,

maintainer
#3 lore raw
In reply to Claus Hansen Ries
Quoted 4 lines · Claus Hansen Ries

From: Claus Hansen Ries <[email protected]>

Hope I am resubmitting this correctly, I've fixed the issues in the original submission.

Sorry for nit picking, but please re-submit dropping the above line, you probably don't want them in git history, too.

In the next submission you can retain the already collected RB tag.

Additionally it looks like the From matches the sender email address:
it's not needed (but it does not hurt not will produce any differences in git history).

Cheers,

Paolo

#4 lore raw

PATCH v3 1/1 net: ll_temac: platform_get_resource replaced by wrong function

In reply to Claus Hansen Ries

The function platform_get_resource was replaced with devm_platform_ioremap_resource_byname and is called using 0 as name.

This eventually ends up in platform_get_resource_byname in the call stack, where it causes a null pointer in strcmp.

	if (type == resource_type(r) && !strcmp(r->name, name))

It should have been replaced with devm_platform_ioremap_resource.

Fixes bd69058f50d5 ("net: ll_temac: Use devm_platform_ioremap_resource_byname()")

---
v3:
- Cleanup of patch message
v2: https://marc.info/?l=linux-netdev&m=171094427802626&w=2
- fix accidently converting tabs to spaces and wording in commit message
v1: https://marc.info/?l=linux-netdev&m=171087828129633&w=2

 drivers/net/ethernet/xilinx/ll_temac_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/xilinx/ll_temac_main.c +1 -1
index 9df39cf8b097..1072e2210aed 100644
@@ -1443,7 +1443,7 @@ static int temac_probe(struct platform_device *pdev)
 	}
 
 	/* map device registers */
-	lp->regs = devm_platform_ioremap_resource_byname(pdev, 0);
+	lp->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(lp->regs)) {
 		dev_err(&pdev->dev, "could not map TEMAC registers\n");
 		return -ENOMEM;

base-commit: d95fcdf4961d27a3d17e5c7728367197adc89b8d

Signature · 1 line
2.39.3 (Apple Git-146)
#5 lore raw
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Thu, 21 Mar 2024 13:08:59 +0000 you wrote:

The function platform_get_resource was replaced with devm_platform_ioremap_resource_byname and is called using 0 as name.

This eventually ends up in platform_get_resource_byname in the call stack, where it causes a null pointer in strcmp.

	if (type == resource_type(r) && !strcmp(r->name, name))

[...]

Here is the summary with links:
- [net,v3] net: ll_temac: platform_get_resource replaced by wrong function

    https://git.kernel.org/netdev/net/c/3a38a829c8bc

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html