]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
phy: tegra: Handle return value of kasprintf
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Wed, 20 Sep 2017 07:05:57 +0000 (12:35 +0530)
committerKishon Vijay Abraham I <kishon@ti.com>
Tue, 26 Sep 2017 11:32:48 +0000 (17:02 +0530)
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>
drivers/phy/tegra/xusb.c

index 3cbcb2537657623444c65ab59aa6300b7b66526f..4307bf0013e186cd859b779aaaf4c61ddd662a6c 100644 (file)
@@ -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);
        }