Re: [PATCH] staging: atomisp: fix memory leak in sh_css_load_firmware on error path

From: Andy Shevchenko

Date: Thu Apr 02 2026 - 03:19:24 EST


On Wed, Apr 1, 2026 at 8:02 PM Sairam Bandikanti
<sairambandikanti@xxxxxxxxx> wrote:
>
> sh_css_load_firmware() allocates sh_css_blob_info and fw_minibuffer but
> all error paths inside the firmware parsing loop use bare 'return'
> statements, leaking both allocations. Additionally, when the
> fw_minibuffer allocation itself fails, sh_css_blob_info is leaked.
>
> Replace all bare returns with goto to a common err_alloc cleanup label
> that frees both allocations before returning.

NAK.

> Signed-off-by: Sairam Bandikanti <sairambandikanti@xxxxxxxxx>
> Assisted-by: Claude <noreply@xxxxxxxxxxxxx>

Please, use your skills to investigate what the code is doing and not
blindly follow some stupid AI.

--
With Best Regards,
Andy Shevchenko