提交 3c5972ff 编写于 作者: M Miaoqian Lin 提交者: Yongqiang Liu

phy: tegra: xusb: Fix return value of tegra_xusb_find_port_node function

mainline inclusion
from mainline-v5.17-rc1
commit 045a31b9
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I6IXQP
CVE: CVE-2023-23000

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=045a31b95509c8f25f5f04ec5e0dec5cd09f2c5f

--------------------------------

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: NMiaoqian Lin <linmq006@gmail.com>
Acked-by: NThierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20211213020507.1458-1-linmq006@gmail.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
Signed-off-by: NWang Yufen <wangyufen@huawei.com>
Reviewed-by: NYue Haibing <yuehaibing@huawei.com>
Reviewed-by: NWang Weiyang <wangweiyang2@huawei.com>
Signed-off-by: NYongqiang Liu <liuyongqiang13@huawei.com>
上级 ee8628e1
...@@ -441,7 +441,7 @@ tegra_xusb_find_port_node(struct tegra_xusb_padctl *padctl, const char *type, ...@@ -441,7 +441,7 @@ tegra_xusb_find_port_node(struct tegra_xusb_padctl *padctl, const char *type,
name = kasprintf(GFP_KERNEL, "%s-%u", type, index); name = kasprintf(GFP_KERNEL, "%s-%u", type, index);
if (!name) { if (!name) {
of_node_put(ports); of_node_put(ports);
return ERR_PTR(-ENOMEM); return NULL;
} }
np = of_get_child_by_name(ports, name); np = of_get_child_by_name(ports, name);
kfree(name); kfree(name);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册