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]
Date:   Wed, 9 Nov 2022 12:43:13 +0200
From:   Oleh Kravchenko <oleg@....org.ua>
To:     wangyufen <wangyufen@...wei.com>
Cc:     linux-leds@...r.kernel.org, linux-kernel@...r.kernel.org,
        Pavel Machek <pavel@....cz>
Subject: Re: [PATCH 02/13] leds: el15203000: Fix devm vs. non-devm ordering



> 9 лист. 2022 р. о 12:25 wangyufen <wangyufen@...wei.com> написав(ла):
> 
> 
> 在 2022/11/9 17:39, Oleh Kravchenko 写道:
>> Hello all!
>> 
>>> 9 лист. 2022 р. о 10:48 Wang Yufen <wangyufen@...wei.com> написав(ла):
>>> 
>>> return el15203000_probe_dt(priv);
>>> }
>>> 
>>> -static void el15203000_remove(struct spi_device *spi)
>> Is remove() callback from struct spi_driver deprecated?
> 
> It is not that remove() callback is deprecated,
> it's that after wrapping mutex_destroy() call with devm_add_action_or_reset(),
> remove() callback is unnecessary here.

When remove() is called, the memory allocated by devm_*() is valid.
So what you try to fix here?

> 
>> 
>>> -{
>>> - struct el15203000 *priv = spi_get_drvdata(spi);
>>> -
>>> - mutex_destroy(&priv->lock);
>>> -}
>>> 
>>> static const struct of_device_id el15203000_dt_ids[] = {
>>> { .compatible = "crane,el15203000", },
>>> @@ -331,7 +336,6 @@ static void el15203000_remove(struct spi_device *spi)
>>> 
>>> static struct spi_driver el15203000_driver = {
>>> .probe = el15203000_probe,
>>> - .remove = el15203000_remove,
>>> .driver = {
>>> .name = KBUILD_MODNAME,
>>> .of_match_table = el15203000_dt_ids,
>>> -- 
>>> 1.8.3.1
>>> 
>> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ