Skip to content

Commit

Permalink
phy: tegra: Handle return value of kasprintf
Browse files Browse the repository at this point in the history
kasprintf() can fail and it's return value must be checked.

Signed-off-by: Arvind Yadav <[email protected]>
Signed-off-by: Kishon Vijay Abraham I <[email protected]>
  • Loading branch information
ArvindYadavCs authored and kishon committed Sep 26, 2017
1 parent 2bd6bf0 commit 1df79cb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/phy/tegra/xusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 1df79cb

Please sign in to comment.