diff mbox series

[net,v2] net: ll_temac: platform_get_resource replaced by wrong function

Message ID f512ff25a2cd484791757c18facb526c@terma.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net,v2] net: ll_temac: platform_get_resource replaced by wrong function | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 968 this patch: 967
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 956 this patch: 956
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 985 this patch: 984
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-03-21--12-00 (tests: 908)

Commit Message

Claus Hansen Ries March 20, 2024, 2:19 p.m. UTC
From: Claus Hansen Ries <chr@terma.com>

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()")
Signed-off-by: Claus Hansen Ries <chr@terma.com>
Cc: stable@vger.kernel.org
---
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(-)


base-commit: d95fcdf4961d27a3d17e5c7728367197adc89b8d

Comments

Simon Horman March 20, 2024, 3:22 p.m. UTC | #1
On Wed, Mar 20, 2024 at 02:19:15PM +0000, Claus Hansen Ries wrote:
> From: Claus Hansen Ries <chr@terma.com>
> 
> 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.

> 
> 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()")
> Signed-off-by: Claus Hansen Ries <chr@terma.com>
> Cc: stable@vger.kernel.org
> ---
> v2:
>   - fix accidently converting tabs to spaces and wording in commit message
> v1: https://marc.info/?l=linux-netdev&m=171087828129633&w=2

Thanks,

Reviewed-by: Simon Horman <horms@kernel.org>
Jiri Pirko March 20, 2024, 4:06 p.m. UTC | #2
Wed, Mar 20, 2024 at 04:22:46PM CET, horms@kernel.org wrote:
>On Wed, Mar 20, 2024 at 02:19:15PM +0000, Claus Hansen Ries wrote:
>> From: Claus Hansen Ries <chr@terma.com>
>> 
>> 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 :)


>
>> 
>> 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()")
>> Signed-off-by: Claus Hansen Ries <chr@terma.com>
>> Cc: stable@vger.kernel.org
>> ---
>> v2:
>>   - fix accidently converting tabs to spaces and wording in commit message
>> v1: https://marc.info/?l=linux-netdev&m=171087828129633&w=2
>
>Thanks,
>
>Reviewed-by: Simon Horman <horms@kernel.org>
>
Paolo Abeni March 21, 2024, 12:51 p.m. UTC | #3
On Wed, 2024-03-20 at 14:19 +0000, Claus Hansen Ries wrote:
> From: Claus Hansen Ries <chr@terma.com>
> 
> 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
diff mbox series

Patch

diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c
index 9df39cf8b097..1072e2210aed 100644
--- a/drivers/net/ethernet/xilinx/ll_temac_main.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
@@ -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;