mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
Input: ims-pcu - fix firmware leak in async update
[ Upstream commitd48795b5cd] The firmware object was not being released if validation failed. Use __free(firmware) to ensure the firmware is always released. Fixes:628329d524("Input: add IMS Passenger Control Unit driver") Cc: stable@vger.kernel.org Reported-by: Sashiko bot <sashiko-bot@kernel.org> Assisted-by: Gemini:gemini-3.1-pro Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
5e7cd480fb
commit
a5dd47ea39
@@ -964,9 +964,10 @@ out:
|
||||
return retval;
|
||||
}
|
||||
|
||||
static void ims_pcu_process_async_firmware(const struct firmware *fw,
|
||||
static void ims_pcu_process_async_firmware(const struct firmware *_fw,
|
||||
void *context)
|
||||
{
|
||||
const struct firmware *fw __free(firmware) = _fw;
|
||||
struct ims_pcu *pcu = context;
|
||||
int error;
|
||||
|
||||
@@ -987,8 +988,6 @@ static void ims_pcu_process_async_firmware(const struct firmware *fw,
|
||||
ims_pcu_handle_firmware_update(pcu, fw);
|
||||
mutex_unlock(&pcu->cmd_mutex);
|
||||
|
||||
release_firmware(fw);
|
||||
|
||||
out:
|
||||
complete(&pcu->async_firmware_done);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user