提交 1df79cb3 编写于 作者: A Arvind Yadav 提交者: Kishon Vijay Abraham I

phy: tegra: Handle return value of kasprintf

kasprintf() can fail and it's return value must be checked.
Signed-off-by: NArvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: NKishon Vijay Abraham I <kishon@ti.com>
上级 2bd6bf03
...@@ -454,6 +454,8 @@ tegra_xusb_find_port_node(struct tegra_xusb_padctl *padctl, const char *type, ...@@ -454,6 +454,8 @@ tegra_xusb_find_port_node(struct tegra_xusb_padctl *padctl, const char *type,
char *name; char *name;
name = kasprintf(GFP_KERNEL, "%s-%u", type, index); name = kasprintf(GFP_KERNEL, "%s-%u", type, index);
if (!name)
return ERR_PTR(-ENOMEM);
np = of_find_node_by_name(np, name); np = of_find_node_by_name(np, name);
kfree(name); kfree(name);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册