lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aUPm-NsUJXxV8FT0@stanley.mountain>
Date: Thu, 18 Dec 2025 14:35:20 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Valentina Fernandez <valentina.fernandezalanis@...rochip.com>
Cc: jassisinghbrar@...il.com, conor.dooley@...rochip.com,
	linux-kernel@...r.kernel.org, lkp@...el.com
Subject: Re: [PATCH v1] mailbox: mchp-ipc-sbi: fix uninitialized symbol and
 other smatch warnings

On Thu, Dec 18, 2025 at 02:23:03PM +0300, Dan Carpenter wrote:
> On Thu, Dec 18, 2025 at 10:33:59AM +0000, Valentina Fernandez wrote:
> > Fix uninitialized symbol 'hartid' warning in mchp_ipc_cluster_aggr_isr()
> > by introducing a 'found' flag to track whether the IRQ matches any
> > online hart. If no match is found, return IRQ_NONE.
> > 
> > Also fix other smatch warnings by removing dead code in
> > mchp_ipc_startup() and by returning -ENODEV in dev_err_probe() if the
> > Microchip SBI extension is not found.
> > 
> > Fixes below smatch warnings:
> > drivers/mailbox/mailbox-mchp-ipc-sbi.c:187 mchp_ipc_cluster_aggr_isr() error: uninitialized symbol 'hartid'.
> > drivers/mailbox/mailbox-mchp-ipc-sbi.c:324 mchp_ipc_startup() warn: ignoring unreachable code.
> > drivers/mailbox/mailbox-mchp-ipc-sbi.c:422 mchp_ipc_probe() warn: passing zero to 'dev_err_probe'
> > 
> > Reported-by: kernel test robot <lkp@...el.com>
> > Reported-by: Dan Carpenter <dan.carpenter@...aro.org>
> > Closes: https://lore.kernel.org/r/202512171533.CDLdScMY-lkp@intel.com/
> > Signed-off-by: Valentina Fernandez <valentina.fernandezalanis@...rochip.com>
> > ---
> >  drivers/mailbox/mailbox-mchp-ipc-sbi.c | 21 +++++++++------------
> >  1 file changed, 9 insertions(+), 12 deletions(-)
> > 
> > diff --git a/drivers/mailbox/mailbox-mchp-ipc-sbi.c b/drivers/mailbox/mailbox-mchp-ipc-sbi.c
> > index d444491a584e..b87bf2fb4b9b 100644
> > --- a/drivers/mailbox/mailbox-mchp-ipc-sbi.c
> > +++ b/drivers/mailbox/mailbox-mchp-ipc-sbi.c
> > @@ -174,17 +174,21 @@ static irqreturn_t mchp_ipc_cluster_aggr_isr(int irq, void *data)
> >  	struct mchp_ipc_msg ipc_msg;
> >  	struct mchp_ipc_status status_msg;
> >  	int ret;
> > -	unsigned long hartid;
> >  	u32 i, chan_index, chan_id;
> > +	bool found = false;
> >  
> >  	/* Find out the hart that originated the irq */
> >  	for_each_online_cpu(i) {
> > -		hartid = cpuid_to_hartid_map(i);
> > -		if (irq == ipc->cluster_cfg[i].irq)
> > +		if (irq == ipc->cluster_cfg[i].irq) {
> > +			found = true;
> >  			break;
> > +		}
> >  	}
> >  
> > -	status_msg.cluster = hartid;
> > +	if (unlikely(!found))
> > +		return IRQ_NONE;
> 
> This one is a false positive because obviously there is going to be
> at least one online cpu.  I would prefer to silence this in Smatch.
> Generally, you should ignore static checker false positives.

Well...  I guess the bug is real, but the warning was bogus.  It was
a broken clock warning which works by chance twice a day.

regards,
dan carpenter


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ