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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <cf42e001f0c0cdec382419acd8edfc0088f08c96.camel@fi.rohmeurope.com>
Date:   Mon, 24 May 2021 05:01:59 +0000
From:   "Vaittinen, Matti" <Matti.Vaittinen@...rohmeurope.com>
To:     "bgolaszewski@...libre.com" <bgolaszewski@...libre.com>
CC:     linux-power <linux-power@...rohmeurope.com>,
        "linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
        "michael@...le.cc" <michael@...le.cc>,
        "bjorn@...k.no" <bjorn@...k.no>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linus.walleij@...aro.org" <linus.walleij@...aro.org>
Subject: Re: [PATCH v2 2/3] gpio: gpio-regmap: Use devm_add_action()

Morning folks!

On Fri, 2021-05-21 at 18:35 +0200, Bartosz Golaszewski wrote:
> On Fri, May 21, 2021 at 12:31 PM Vaittinen, Matti
> <Matti.Vaittinen@...rohmeurope.com> wrote:
> > 
> > On Fri, 2021-05-21 at 10:38 +0200, Bjørn Mork wrote:
> > > Michael Walle <michael@...le.cc> writes:
> > > 
> > > > Am 2021-05-21 08:28, schrieb Matti Vaittinen:
> > > > > Slightly simplify the devm_gpio_regmap_register() by using
> > > > > the
> > > > > devm_add_action().
> > > > 
> > > > 
> > > You should probably use the devm_add_action_or_reset() wrapper
> > > here
> > > too,
> > > catching the unlikely devm_add_action() alloc failure.
> > > 
> > 
> > I was thinking of it but as the gpio registration succeeded I was
> > thinking that we could go on with it - (which means we can proceed
> > but
> > the gpio is never released.)
> > 
> > I am not sure how much difference it makes in the case of small
> > alloc
> > failure ;)
> > 
> > But as it seems I am in any case re-spinning this I can change this
> > to
> > the devm_add_action_or_reset() and fail the gpio_regmap
> > registration if
> > alloc fails.
> > 
> > Best Regards
> >         Matti Vaittinen
> 
> Hi Matti,
> 
> Please use the reset variant. We always want to roll-back the changes
> done in a function before the failure and propagate the error code.

Right. I'll do that. I hope to be able to re-spin this today.

Best Regards
	-- Matti

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ