aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/fpga/microchip-spi.c
diff options
context:
space:
mode:
authorPetr Pavlu <[email protected]>2025-06-18 12:26:26 +0000
committerDaniel Gomez <[email protected]>2025-07-08 18:52:29 +0000
commitca3881f6fd8e9b6eb2d51e8718d07d3b8029d886 (patch)
treea65408f73d82a8ecac4d7fe09c67f72fe57176e0 /drivers/fpga/microchip-spi.c
parentLinux 6.16-rc5 (diff)
downloadkernel-ca3881f6fd8e9b6eb2d51e8718d07d3b8029d886.tar.gz
kernel-ca3881f6fd8e9b6eb2d51e8718d07d3b8029d886.zip
module: Fix memory deallocation on error path in move_module()
The function move_module() uses the variable t to track how many memory types it has allocated and consequently how many should be freed if an error occurs. The variable is initially set to 0 and is updated when a call to module_memory_alloc() fails. However, move_module() can fail for other reasons as well, in which case t remains set to 0 and no memory is freed. Fix the problem by initializing t to MOD_MEM_NUM_TYPES. Additionally, make the deallocation loop more robust by not relying on the mod_mem_type_t enum having a signed integer as its underlying type. Fixes: c7ee8aebf6c0 ("module: add stop-grap sanity check on module memcpy()") Signed-off-by: Petr Pavlu <[email protected]> Reviewed-by: Sami Tolvanen <[email protected]> Reviewed-by: Daniel Gomez <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daniel Gomez <[email protected]> Message-ID: <[email protected]>
Diffstat (limited to 'drivers/fpga/microchip-spi.c')
0 files changed, 0 insertions, 0 deletions