mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
Input: ims-pcu - fix firmware leak in async update
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>
This commit is contained in:
parent
ca459e237b
commit
d48795b5cd
|
|
@ -935,9 +935,10 @@ static int ims_pcu_handle_firmware_update(struct ims_pcu *pcu,
|
|||
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;
|
||||
|
||||
|
|
@ -957,8 +958,6 @@ static void ims_pcu_process_async_firmware(const struct firmware *fw,
|
|||
scoped_guard(mutex, &pcu->cmd_mutex)
|
||||
ims_pcu_handle_firmware_update(pcu, fw);
|
||||
|
||||
release_firmware(fw);
|
||||
|
||||
out:
|
||||
complete(&pcu->async_firmware_done);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user