Re: [PATCH] HID: microsoft: add a call hid_hw_stop() in probe()

From: Jeongjun Park
Date: Wed Jul 16 2025 - 22:59:16 EST


Hello,

Andrey Smirnov <andrew.smirnov@xxxxxxxxx> wrote:
>
> On Wed, Jul 16, 2025 at 10:22 AM Jeongjun Park <aha310510@xxxxxxxxx> wrote:
> >
> > If hid_hw_start() succeeds but ms_init_ff() fails, it will return without
> > calling hid_hw_stop(), which will cause a memory leak. So to prevent this,
> > we need to change probe() to call hid_hw_stop().
> >
>
> If I recall correctly (and it's been a _long_ time since I've looked
> at this code) we intentionally didn't call `hid_hw_stop()` so that
> you'd still have a functional device even if FF feature initialization
> failed. What's the leak mechanism here?
>

I misinterpreted the code.

Thanks for letting me know that ms_init_ff() is designed not to stop the
HW if it fails!

Regards,

Jeongjun Park