Re: [PATCH] Input: reject parent overrides on managed input devices

From: Christian Lamparter

Date: Sun Oct 11 2026 - 14:13:29 EST


On Sat, Oct 10, 2026 at 5:54 AM Dmitry Torokhov
<dmitry.torokhov@xxxxxxxxx> wrote:
>
> When an input device is allocated with devm_input_allocate_device(), the
> owner struct device is set as dev->dev.parent and holds the
> devm_input_device_release resource. Later, input_register_device()
> attaches the devm_input_device_unregister resource to dev->dev.parent.

Ok, why would this be a problem? If something other than the devres
garbage collection
callback access the data after it was unregistered... what else is
supposed to happen
other than a crash.

for what's worth: this patch seems to be a "spite" response to this:
https://lore.kernel.org/linux-wireless/20261008-carl9170-reverts-v2-0-3ecb12089797@xxxxxxxxx/

I think someone else is working on a separate fix:
https://lwn.net/Articles/1038523/: "Revocable references for transient devices"
With todays Patch-Series V14 on: https://lkml.org/lkml/2026/10/11/475

>From what I can tell, this should have been what devres was trying to solve.

Cheers,
Christian