The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "tip-bot2 for Dan Carpenter" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Dan Carpenter <dan.carpenter@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Nam Cao <namcao@linutronix.de>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: irq/drivers] irqchip/ls-scfg-msi: Fix NULL dereference in error handling
Date: Fri, 18 Jul 2025 12:59:14 -0000	[thread overview]
Message-ID: <175284355454.406.2721767581082329657.tip-bot2@tip-bot2> (raw)
In-Reply-To: <15059507-6422-4333-94ca-e8e8840bd289@sabinyo.mountain>

The following commit has been merged into the irq/drivers branch of tip:

Commit-ID:     aabf4ff06b9789f3cd167bf9e2eb25f1fdb5541a
Gitweb:        https://git.kernel.org/tip/aabf4ff06b9789f3cd167bf9e2eb25f1fdb5541a
Author:        Dan Carpenter <dan.carpenter@linaro.org>
AuthorDate:    Wed, 16 Jul 2025 14:43:45 -05:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Fri, 18 Jul 2025 14:54:45 +02:00

irqchip/ls-scfg-msi: Fix NULL dereference in error handling

The call to irq_domain_remove(msi_data->parent); was accidentally left
behind during a code refactor.  It's not necessary to free
"msi_data->parent" because it is NULL and, in fact, trying to free it
will lead to a NULL pointer dereference.  Delete the unnecessary code.

Fixes: 94b59d5f567a ("irqchip/ls-scfg-msi: Switch to use msi_create_parent_irq_domain()")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Nam Cao <namcao@linutronix.de>
Link: https://lore.kernel.org/all/15059507-6422-4333-94ca-e8e8840bd289@sabinyo.mountain

---
 drivers/irqchip/irq-ls-scfg-msi.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/irqchip/irq-ls-scfg-msi.c b/drivers/irqchip/irq-ls-scfg-msi.c
index 7eca751..4910f36 100644
--- a/drivers/irqchip/irq-ls-scfg-msi.c
+++ b/drivers/irqchip/irq-ls-scfg-msi.c
@@ -226,7 +226,6 @@ static int ls_scfg_msi_domains_init(struct ls_scfg_msi *msi_data)
 	msi_data->parent = msi_create_parent_irq_domain(&info, &ls_scfg_msi_parent_ops);
 	if (!msi_data->parent) {
 		dev_err(&msi_data->pdev->dev, "failed to create MSI domain\n");
-		irq_domain_remove(msi_data->parent);
 		return -ENOMEM;
 	}
 

      parent reply	other threads:[~2025-07-18 12:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-16 19:43 [PATCH next] irqchip/ls-scfg-msi: Fix NULL dereference in error handling Dan Carpenter
2025-07-16 19:58 ` Nam Cao
2025-07-18 12:59 ` tip-bot2 for Dan Carpenter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=175284355454.406.2721767581082329657.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=dan.carpenter@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=namcao@linutronix.de \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox