From: Jeongjun Park <aha310510@gmail.com>
To: dtor@mail.ru
Cc: aha310510@gmail.com, bentiss@kernel.org, jikos@kernel.org,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
x0r@dv-life.ru
Subject: Re: [PATCH] HID: axff: add cleanup allocated struct axff_device heap
Date: Wed, 20 Aug 2025 13:43:21 +0900 [thread overview]
Message-ID: <20250820044321.918076-1-aha310510@gmail.com> (raw)
In-Reply-To: <fv32i2ejsupm64mpadzsfudaeuzkavkazpmnn2e4ijqeobl4gs@porr2zpxn4aj>
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
prev parent reply other threads:[~2025-08-20 4:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-18 15:43 Jeongjun Park
2025-08-18 17:20 ` Dmitry Torokhov
2025-08-20 4:43 ` Jeongjun Park [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250820044321.918076-1-aha310510@gmail.com \
--to=aha310510@gmail.com \
--cc=bentiss@kernel.org \
--cc=dtor@mail.ru \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=x0r@dv-life.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®