diff mbox series

[SRU,Jammy,Focal,1/1] phy: tegra: xusb: Fix return value of tegra_xusb_find_port_node function

Message ID 20240220214443.40506-2-bethany.jamison@canonical.com
State New
Headers show
Series [SRU,Jammy,Focal,1/1] phy: tegra: xusb: Fix return value of tegra_xusb_find_port_node function | expand

Commit Message

Bethany Jamison Feb. 20, 2024, 9:44 p.m. UTC
From: Miaoqian Lin <linmq006@gmail.com>

callers of tegra_xusb_find_port_node() function only do NULL checking for
the return value. return NULL instead of ERR_PTR(-ENOMEM) to keep
consistent.

Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20211213020507.1458-1-linmq006@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
(cherry picked from commit 045a31b95509c8f25f5f04ec5e0dec5cd09f2c5f)
CVE-2023-23000
Signed-off-by: Bethany Jamison <bethany.jamison@canonical.com>
---
 drivers/phy/tegra/xusb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andrei Gherzan Feb. 21, 2024, 10:46 a.m. UTC | #1
On 24/02/20 03:44PM, Bethany Jamison wrote:
> From: Miaoqian Lin <linmq006@gmail.com>
> 
> callers of tegra_xusb_find_port_node() function only do NULL checking for
> the return value. return NULL instead of ERR_PTR(-ENOMEM) to keep
> consistent.
> 
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> Acked-by: Thierry Reding <treding@nvidia.com>
> Link: https://lore.kernel.org/r/20211213020507.1458-1-linmq006@gmail.com
> Signed-off-by: Vinod Koul <vkoul@kernel.org>
> (cherry picked from commit 045a31b95509c8f25f5f04ec5e0dec5cd09f2c5f)
> CVE-2023-23000
> Signed-off-by: Bethany Jamison <bethany.jamison@canonical.com>
> ---
>  drivers/phy/tegra/xusb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c
> index 119e2c039225f..6869d82e9ac96 100644
> --- a/drivers/phy/tegra/xusb.c
> +++ b/drivers/phy/tegra/xusb.c
> @@ -455,7 +455,7 @@ tegra_xusb_find_port_node(struct tegra_xusb_padctl *padctl, const char *type,
>  	name = kasprintf(GFP_KERNEL, "%s-%u", type, index);
>  	if (!name) {
>  		of_node_put(ports);
> -		return ERR_PTR(-ENOMEM);
> +		return NULL;
>  	}
>  	np = of_get_child_by_name(ports, name);
>  	kfree(name);

Acked-by: Andrei Gherzan <andrei.gherzan@canonical.com>
diff mbox series

Patch

diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c
index 119e2c039225f..6869d82e9ac96 100644
--- a/drivers/phy/tegra/xusb.c
+++ b/drivers/phy/tegra/xusb.c
@@ -455,7 +455,7 @@  tegra_xusb_find_port_node(struct tegra_xusb_padctl *padctl, const char *type,
 	name = kasprintf(GFP_KERNEL, "%s-%u", type, index);
 	if (!name) {
 		of_node_put(ports);
-		return ERR_PTR(-ENOMEM);
+		return NULL;
 	}
 	np = of_get_child_by_name(ports, name);
 	kfree(name);