Skip to contentSkip to conversation

irqchip/qcom-mpm: Replace devm_kasprintf() call by devm_kstrdup() in qcom_mpm_init()

PATCH New Markus Elfring 1 participant 1 message Apr 16, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 irqchip/qcom-mpm: Replace devm_kasprintf() call by devm_kstrdup() in qcom_mpm_init()

From: Markus Elfring <[email protected]>
Date: Wed, 16 Apr 2025 15:43:46 +0200

Use a devm_kstrdup() call instead of a devm_kasprintf() call in this function implementation because only a single string should be copied.

The source code was transformed by using the Coccinelle software.

---
 drivers/irqchip/irq-qcom-mpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-qcom-mpm.c +1 -1
index 7942d8eb3d00..d3e398e03d3f 100644
@@ -414,7 +414,7 @@ static int qcom_mpm_init(struct device_node *np, struct device_node *parent)
 	genpd->flags = GENPD_FLAG_IRQ_SAFE;
 	genpd->power_off = mpm_pd_power_off;
 
-	genpd->name = devm_kasprintf(dev, GFP_KERNEL, "%s", dev_name(dev));
+	genpd->name = devm_kstrdup(dev, dev_name(dev), GFP_KERNEL);
 	if (!genpd->name)
 		return -ENOMEM;
 
Signature · 1 line
2.49.0