Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1735579 > unrolled thread

[PATCH] phy: tegra: Handle return value of kasprintf

Started byArvind Yadav <arvind.yadav.cs@gmail.com>
First post2017-09-20 09:10 +0200
Last post2017-09-20 09:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] phy: tegra: Handle return value of kasprintf Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-09-20 09:10 +0200

#1735579 — [PATCH] phy: tegra: Handle return value of kasprintf

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-09-20 09:10 +0200
Subject[PATCH] phy: tegra: Handle return value of kasprintf
Message-ID<urHiX-8bg-61@gated-at.bofh.it>
kasprintf() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/phy/tegra/xusb.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c
index 3cbcb25..4307bf0 100644
--- a/drivers/phy/tegra/xusb.c
+++ b/drivers/phy/tegra/xusb.c
@@ -454,6 +454,8 @@ struct tegra_xusb_lane *
 		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);
 	}
-- 
1.9.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web