[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20250820044321.918076-1-aha310510@gmail.com>
Date: Wed, 20 Aug 2025 13:43:21 +0900
From: Jeongjun Park <aha310510@...il.com>
To: dtor@...l.ru
Cc: aha310510@...il.com,
bentiss@...nel.org,
jikos@...nel.org,
linux-input@...r.kernel.org,
linux-kernel@...r.kernel.org,
x0r@...life.ru
Subject: Re: [PATCH] HID: axff: add cleanup allocated struct axff_device heap
Hello Dmitry,
Dmitry Torokhov wrote:
> Hi Jeongjun,
>
> On Tue, Aug 19, 2025 at 12:43:02AM +0900, Jeongjun Park wrote:
> > Currently, acrux hid driver allocates heap memory equal to
> > sizeof(struct axff_device) to support force feedback, but there's no code
> > to free this memory except when initialization fails. This causes the
> > allocated memory to not be freed even if the driver is detached.
> >
> > Therefore, to properly clean up and safely manage the allocated heap,
> > must be modified to use devm_kzalloc().
>
> You have not tested this, have you? The private data that is passed to
> input_ff_create_memless() is freed by ml_ff_destroy() which is invoked
> when input core calls input_ff_destroy() as part of input device
> teardown. Your change introduces double-free.
Oops, I checked again and realized my patch was a complete mess.
Thanks for letting me know!
Regards,
Jeongjun Park
Powered by blists - more mailing lists