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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251025103332.GA7775@google.com>
Date: Sat, 25 Oct 2025 11:33:32 +0100
From: Lee Jones <lee@...nel.org>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc: Haotian Zhang <vulab@...as.ac.cn>,
	Support Opensource <support.opensource@...semi.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mfd: da9055: Fix missing regmap_del_irq_chip() in error
 path

On Fri, 10 Oct 2025, Christophe JAILLET wrote:

> Le 10/10/2025 à 03:17, Haotian Zhang a écrit :
> > When da9055_device_init() fails after regmap_add_irq_chip()
> > succeeds but mfd_add_devices() fails, the error handling path
> > only calls mfd_remove_devices() but forgets to call
> > regmap_del_irq_chip(). This results in a resource leak.
> > 
> > Fix this by adding regmap_del_irq_chip() to the error path so
> > that resources are released properly.
> > 
> > Fixes: 2896434cf272 ("mfd: DA9055 core driver")
> > Signed-off-by: Haotian Zhang <vulab@...as.ac.cn>
> > ---
> >   drivers/mfd/da9055-core.c | 1 +
> >   1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/mfd/da9055-core.c b/drivers/mfd/da9055-core.c
> > index 1f727ef60d63..8c989b74f924 100644
> > --- a/drivers/mfd/da9055-core.c
> > +++ b/drivers/mfd/da9055-core.c
> > @@ -388,6 +388,7 @@ int da9055_device_init(struct da9055 *da9055)
> >   err:
> >   	mfd_remove_devices(da9055->dev);
> 
> I don't think that mfd_remove_devices() is needed here. Looks harmless, but
> should mfd_add_devices() fail, this clean-up is already done (see [1]).
> 
> CJ
> 
> [1]:
> https://elixir.bootlin.com/linux/v6.17.1/source/drivers/mfd/mfd-core.c#L337

Agree.  I look forward to your patch.

-- 
Lee Jones [李琼斯]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ