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>
tirimbino
Arvind Yadav 7 years ago committed by Kishon Vijay Abraham I
parent 2bd6bf03f4
commit 1df79cb3ba
  1. 2
      drivers/phy/tegra/xusb.c

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

Loading…
Cancel
Save