Re: [PATCH] HID: playstation: Fix memory leak in dualshock4_get_calibration_data()

From: Abdun Nihaal
Date: Tue Nov 11 2025 - 06:29:02 EST


On Mon, Nov 10, 2025 at 06:49:01PM +0100, Markus Elfring wrote:
> > The memory allocated for buf is not freed in the error paths when
> > ps_get_report() fails. Free buf before jumping to transfer_failed label
>
> Would an additional label become helpful for this function implementation?

In the function, the code present at the transfer_failed label is shared
between normal and error paths, and is not the traditional error path label,
that's why I put the kfree for the two cases immediately before the goto.

Regards,
Nihaal