[Letux-kernel] two accelerometers + iio_bridge considered harmful

Andreas Kemnade andreas at kemnade.info
Tue Jul 31 23:17:11 CEST 2018


On Tue, 31 Jul 2018 21:12:29 +0200
"H. Nikolaus Schaller" <hns at goldelico.com> wrote:

[...]
> Ok, it is unregistered twice...
> Well, the code is simply not good for unregistering.
> Proposal is attached. It should unregister only if anything is registered.
> 
Well, that fixes the oops, but not the case that one accelerometer is
still registered.
And re-registering of course does not work because you do not set
idev to NULL and it is still happily accessed.

> I don't know if it is really better - we might have to track
> 
> iio_input_unregister_accel_channel() and wipe out channel slots by
> that. And have input_register_accel_channel() find an empty one.
> 
> And unregister the input device only when all slots are empty.
> 
well, there seems to be more work done. Well, I have unregistered iio
devices a lot, but in general the problem is of less concern than the
other races there.

Regards,
Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.goldelico.com/pipermail/letux-kernel/attachments/20180731/ff16e5b6/attachment.asc>


More information about the Letux-kernel mailing list