From: Arvind Yadav Date: Wed, 20 Sep 2017 07:05:57 +0000 (+0530) Subject: phy: tegra: Handle return value of kasprintf X-Git-Tag: Ubuntu-5.2.0-15.16~5760^2~14^2~7 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=1df79cb3bae754e4a42240f9851ed82549a44f1a;p=mirror_ubuntu-eoan-kernel.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 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); }