Skip to content

Commit

Permalink
net: ll_temac: platform_get_resource replaced by wrong function
Browse files Browse the repository at this point in the history
commit 3a38a82 upstream.

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: bd69058 ("net: ll_temac: Use devm_platform_ioremap_resource_byname()")
Signed-off-by: Claus Hansen Ries <chr@terma.com>
Cc: stable@vger.kernel.org
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/cca18f9c630a41c18487729770b492bb@terma.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
ClausRies authored and gregkh committed Apr 3, 2024
1 parent 9acfd8b commit 46efbdb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/xilinx/ll_temac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1445,7 +1445,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;
Expand Down

0 comments on commit 46efbdb

Please sign in to comment.