summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2017-09-20 09:05:57 +0200
committerKishon Vijay Abraham I <kishon@ti.com>2017-09-26 13:32:48 +0200
commit1df79cb3bae754e4a42240f9851ed82549a44f1a (patch)
treebab04870848bfcf2256c1c5a4af2376efe51f01a /drivers
parentLinux 4.14-rc1 (diff)
downloadlinux-1df79cb3bae754e4a42240f9851ed82549a44f1a.tar.xz
linux-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')
-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);
}