1
0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2026-01-12 01:20:14 +00:00
Zilin Guan 78b1a242fe scsi: qla2xxx: Fix improper freeing of purex item
In qla2xxx_process_purls_iocb(), an item is allocated via
qla27xx_copy_multiple_pkt(), which internally calls
qla24xx_alloc_purex_item().

The qla24xx_alloc_purex_item() function may return a pre-allocated item
from a per-adapter pool for small allocations, instead of dynamically
allocating memory with kzalloc().

An error handling path in qla2xxx_process_purls_iocb() incorrectly uses
kfree() to release the item. If the item was from the pre-allocated
pool, calling kfree() on it is a bug that can lead to memory corruption.

Fix this by using the correct deallocation function,
qla24xx_free_purex_item(), which properly handles both dynamically
allocated and pre-allocated items.

Fixes: 875386b98857 ("scsi: qla2xxx: Add Unsolicited LS Request and Response Support for NVMe")
Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
Reviewed-by: Himanshu Madhani <hmadhani2024@gmail.com>
Link: https://patch.msgid.link/20251113151246.762510-1-zilin@seu.edu.cn
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-11-19 22:38:27 -05:00
..
2025-10-10 10:37:13 -07:00
2025-10-07 08:40:15 -07:00
2025-10-01 13:59:28 +02:00
2025-10-06 10:37:06 -07:00
2025-10-01 12:52:43 -07:00
2025-10-10 14:02:14 -07:00
2025-10-07 08:40:15 -07:00
2025-10-01 00:00:45 +00:00
2025-10-01 11:34:12 -07:00
2025-09-29 00:17:22 +02:00
2025-10-08 09:44:38 -07:00
2025-10-03 18:18:48 -07:00
2025-10-03 18:48:02 -07:00
2025-10-01 17:32:51 -07:00
2025-10-04 15:50:37 -07:00
2025-10-09 11:13:08 -07:00
2025-09-22 09:35:21 -04:00
2025-10-06 11:17:18 -07:00
2025-10-02 10:16:56 -07:00
2025-10-07 12:13:26 -07:00
2025-10-10 13:05:40 -07:00
2025-10-08 18:51:00 -07:00
2025-10-07 08:59:25 -07:00
2025-10-06 10:34:22 -07:00
2025-10-06 10:41:03 -07:00
2025-10-04 15:28:18 -07:00
2025-10-01 17:32:51 -07:00
2025-10-01 11:34:12 -07:00
2025-10-01 12:04:12 -07:00
2025-10-04 15:45:17 -07:00
2025-10-01 17:32:51 -07:00
2025-10-11 11:56:47 -07:00
2025-10-06 10:32:22 -07:00
2025-10-01 17:32:51 -07:00
2025-10-07 11:41:06 -07:00
2025-10-01 17:32:51 -07:00
2025-10-07 11:36:01 -07:00
2025-10-07 08:40:15 -07:00
2025-10-04 16:07:08 -07:00
2025-10-01 07:24:43 -04:00
2025-09-29 18:48:39 -07:00
2025-10-04 08:48:16 -07:00
2025-10-06 11:00:30 -07:00
2025-10-03 17:41:12 -07:00
2025-10-07 08:40:15 -07:00