From: Arvind Yadav Date: Wed, 20 Sep 2017 07:05:57 +0000 (+0530) Subject: phy: tegra: Handle return value of kasprintf X-Git-Tag: v4.14-rc6~3^2~14^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1df79cb3bae754e4a42240f9851ed82549a44f1a;p=thirdparty%2Fkernel%2Flinux.git phy: tegra: Handle return value of kasprintf kasprintf() can fail and it's return value must be checked. Signed-off-by: Arvind Yadav Signed-off-by: Kishon Vijay Abraham I --- diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c index 3cbcb25376576..4307bf0013e18 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); }