From: Thomas Gleixner <tglx@linutronix.de>
To: Kuan-Wei Chiu <visitorckw@gmail.com>,
anup@brainfault.org, paul.walmsley@sifive.com,
palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr,
maz@kernel.org
Cc: jserv@ccns.ncku.edu.tw, linux-riscv@lists.infradead.org,
linux-kernel@vger.kernel.org,
Kuan-Wei Chiu <visitorckw@gmail.com>,
kernel test robot <lkp@intel.com>,
Dan Carpenter <error27@gmail.com>
Subject: Re: [PATCH] irqchip/riscv-imsic: Fix 'imsic' dereferenced before NULL check
Date: Sun, 03 Aug 2025 00:19:24 +0200 [thread overview]
Message-ID: <87ms8hgydv.ffs@tglx> (raw)
In-Reply-To: <20250801172459.94708-1-visitorckw@gmail.com>
On Sat, Aug 02 2025 at 01:24, Kuan-Wei Chiu wrote:
> Smatch reported a warning in imsic_irqdomain_init():
>
> drivers/irqchip/irq-riscv-imsic-platform.c:317 imsic_irqdomain_init() warn: variable dereferenced before check 'imsic' (see line 311)
>
> The variable imsic was dereferenced before being checked for NULL.
> To fix this, move the initialization of struct irq_domain_info after
> the NULL check to avoid accessing imsic prematurely.
It's fixed already w/o moving the struct into the middle of the code:
https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?h=irq/urgent
But thanks a lot for caring!
Thanks,
tglx
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
WARNING: multiple messages have this Message-ID (diff)
From: Thomas Gleixner <tglx@linutronix.de>
To: Kuan-Wei Chiu <visitorckw@gmail.com>,
anup@brainfault.org, paul.walmsley@sifive.com,
palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr,
maz@kernel.org
Cc: jserv@ccns.ncku.edu.tw, linux-riscv@lists.infradead.org,
linux-kernel@vger.kernel.org,
Kuan-Wei Chiu <visitorckw@gmail.com>,
kernel test robot <lkp@intel.com>,
Dan Carpenter <error27@gmail.com>
Subject: Re: [PATCH] irqchip/riscv-imsic: Fix 'imsic' dereferenced before NULL check
Date: Sun, 03 Aug 2025 00:19:24 +0200 [thread overview]
Message-ID: <87ms8hgydv.ffs@tglx> (raw)
In-Reply-To: <20250801172459.94708-1-visitorckw@gmail.com>
On Sat, Aug 02 2025 at 01:24, Kuan-Wei Chiu wrote:
> Smatch reported a warning in imsic_irqdomain_init():
>
> drivers/irqchip/irq-riscv-imsic-platform.c:317 imsic_irqdomain_init() warn: variable dereferenced before check 'imsic' (see line 311)
>
> The variable imsic was dereferenced before being checked for NULL.
> To fix this, move the initialization of struct irq_domain_info after
> the NULL check to avoid accessing imsic prematurely.
It's fixed already w/o moving the struct into the middle of the code:
https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?h=irq/urgent
But thanks a lot for caring!
Thanks,
tglx
next prev parent reply other threads:[~2025-08-02 22:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-01 17:24 [PATCH] irqchip/riscv-imsic: Fix 'imsic' dereferenced before NULL check Kuan-Wei Chiu
2025-08-01 17:24 ` Kuan-Wei Chiu
2025-08-02 22:19 ` Thomas Gleixner [this message]
2025-08-02 22:19 ` Thomas Gleixner
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=87ms8hgydv.ffs@tglx \
--to=tglx@linutronix.de \
--cc=alex@ghiti.fr \
--cc=anup@brainfault.org \
--cc=aou@eecs.berkeley.edu \
--cc=error27@gmail.com \
--cc=jserv@ccns.ncku.edu.tw \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=lkp@intel.com \
--cc=maz@kernel.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=visitorckw@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.