From 9ed2a451334aaf016dcbc9a0f2f26859c5969977 Mon Sep 17 00:00:00 2001 From: Anup Vishwakarma Date: Mon, 21 Sep 2026 19:51:11 +0530 Subject: [PATCH] mailbox: qcom-ipcc: Use dev_name() as IRQ name instead of a static counter qcom_ipcc_probe() uses a function-static int id incremented with plain id++ to generate unique IRQ names. Under async or deferred probe, two instances can probe concurrently and read the same value before either increments, producing duplicate IRQ names. The device already has a unique name assigned by the platform bus. Use dev_name(&pdev->dev) directly as the IRQ name. This eliminates the racy counter, the name buffer, and the devm_kasprintf() allocation entirely, while providing a more informative IRQ name in /proc/interrupts. Signed-off-by: Anup Vishwakarma Reviewed-by: Konrad Dybcio Signed-off-by: Jassi Brar --- drivers/mailbox/qcom-ipcc.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/mailbox/qcom-ipcc.c b/drivers/mailbox/qcom-ipcc.c index 43985fe6816c..232fb4ce999a 100644 --- a/drivers/mailbox/qcom-ipcc.c +++ b/drivers/mailbox/qcom-ipcc.c @@ -288,8 +288,6 @@ static int qcom_ipcc_probe(struct platform_device *pdev) { struct qcom_ipcc *ipcc; u32 config_value; - static int id; - char *name; int ret; ipcc = devm_kzalloc(&pdev->dev, sizeof(*ipcc), GFP_KERNEL); @@ -319,10 +317,6 @@ static int qcom_ipcc_probe(struct platform_device *pdev) if (ipcc->irq < 0) return ipcc->irq; - name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "ipcc_%d", id++); - if (!name) - return -ENOMEM; - ipcc->irq_domain = irq_domain_create_tree(dev_fwnode(&pdev->dev), &qcom_ipcc_irq_ops, ipcc); if (!ipcc->irq_domain) return -ENOMEM; @@ -333,7 +327,7 @@ static int qcom_ipcc_probe(struct platform_device *pdev) ret = devm_request_irq(&pdev->dev, ipcc->irq, qcom_ipcc_irq_fn, IRQF_TRIGGER_HIGH | IRQF_NO_SUSPEND | - IRQF_NO_THREAD, name, ipcc); + IRQF_NO_THREAD, dev_name(&pdev->dev), ipcc); if (ret < 0) goto err_mbox;