phy: tegra: Handle return value of kasprintf

kasprintf() can fail and it's return value must be checked.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
This commit is contained in:
Arvind Yadav 2017-09-20 12:35:57 +05:30 committed by Kishon Vijay Abraham I
parent 2bd6bf03f4
commit 1df79cb3ba

View File

@ -454,6 +454,8 @@ tegra_xusb_find_port_node(struct tegra_xusb_padctl *padctl, const char *type,
char *name;
name = kasprintf(GFP_KERNEL, "%s-%u", type, index);
if (!name)
return ERR_PTR(-ENOMEM);
np = of_find_node_by_name(np, name);
kfree(name);
}