race related to rtc_device_unregister [Was: Re: [PATCH] rtc: pcf2127: add support for accessing internal static] RAM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

On Sun, May 20, 2018 at 10:08:09PM +0200, Alexandre Belloni wrote:
> On 20/05/2018 20:40:01+0200, Uwe Kleine-König wrote:
> > On Sun, May 20, 2018 at 08:05:20PM +0200, Alexandre Belloni wrote:
> > > You must not return an error here once devm_rtc_device_register has
> > > succeeded.
> > 
> > Why? Sounds like something that should be fixed.
> > 
> 
> This is the explanation:
> http://patchwork.ozlabs.org/patch/324263/

So open() should get a reference to the module to ensure it is not freed
while the dev is accessed. The same can happen when the driver is
manually unbound while the device is accessed (which is also fixed when
open() takes a reference).

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |



[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux