On Mon, Jan 31, 2022 at 03:35:38PM +0100, Hans de Goede wrote: > Because there is no way to detect if the touchscreen has pen support, > the driver is allocating and registering the input_pen input_dev on > receiving the first pen event. > > But this means that the input_dev gets allocated after the request_irq() > call which means that the devm framework will free it before disabling > the irq, leaving a window where the irq handler may run and reference the > free-ed input_dev. > > To fix this move the allocation of the input_pen input_dev to before > the request_irq() call, while still only registering it on the first pen > event so that the driver does not advertise pen capability on touchscreens > without it (most goodix touchscreens do not have pen support). > > Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx> Applied, thank you. -- Dmitry