summaryrefslogtreecommitdiffstats
path: root/drivers/phy
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2017-09-20 12:35:57 +0530
committerKishon Vijay Abraham I <kishon@ti.com>2017-09-26 17:02:48 +0530
commit1df79cb3bae754e4a42240f9851ed82549a44f1a (patch)
treebab04870848bfcf2256c1c5a4af2376efe51f01a /drivers/phy
parent2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e (diff)
downloadlinux-stable-1df79cb3bae754e4a42240f9851ed82549a44f1a.tar.gz
linux-stable-1df79cb3bae754e4a42240f9851ed82549a44f1a.tar.bz2
linux-stable-1df79cb3bae754e4a42240f9851ed82549a44f1a.zip
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>
Diffstat (limited to 'drivers/phy')
-rw-r--r--drivers/phy/tegra/xusb.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c
index 3cbcb2537657..4307bf0013e1 100644
--- a/drivers/phy/tegra/xusb.c
+++ b/drivers/phy/tegra/xusb.c
@@ -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);
}