Re: [PATCH -next] firmware_loader: Fix possible resource leak in fw_log_firmware_info()

From: Amadeusz Sławiński
Date: Thu Oct 24 2024 - 03:50:34 EST


On 10/16/2024 1:03 PM, Gaosheng Cui wrote:
The alg instance should be released under the exception path, otherwise
there may be resource leak here.

To mitigate this, free the alg instance with crypto_free_shash when kmalloc
fails.

Fixes: 02fe26f25325 ("firmware_loader: Add debug message with checksum for FW file")
Signed-off-by: Gaosheng Cui <cuigaosheng1@xxxxxxxxxx>
---

Makes sense, thanks!

Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@xxxxxxxxxxxxxxx>