diff options
| author | Ranjan Kumar <ranjan.kumar@broadcom.com> | 2026-09-16 13:57:01 +0530 |
|---|---|---|
| committer | Martin K. Petersen (Oracle) <mkp@kernel.org> | 2026-09-16 22:14:22 -0400 |
| commit | ea8dfd05a0fcabe3ea8bb8a3b9e45b5170a210a2 (patch) | |
| tree | 813252028b546c1e6641b347de21e3999ebdc316 /tools/perf/scripts/python | |
| parent | 7342b9f0e3065c086605f075a204972d270b267b (diff) | |
| download | linux-next-ea8dfd05a0fcabe3ea8bb8a3b9e45b5170a210a2.tar.gz linux-next-ea8dfd05a0fcabe3ea8bb8a3b9e45b5170a210a2.zip | |
scsi: mpi3mr: Fix memory leak on operational queue creation failure
When operational queue creation fails after one or more queues have been
created, the error path frees the queue information arrays but does not
release the DMA memory segments associated with the created queues,
resulting in a memory leak. Fix this by ensuring that partially allocated
segments are freed immediately if a queue fails to create.
Additionally, resolve the following issues in the queue segment free/alloc
paths:
1. Clear mrioc->intr_info[].op_reply_q with WRITE_ONCE() and follow it
with synchronize_irq() before freeing segments, and have the ISR paths
read it once via READ_ONCE() into a local, to close a race where the
ISR could use the pointer while it is being freed.
2. Free q_segment_list before checking q_segments in both free functions,
since a kzalloc_objs() failure on q_segments left q_segment_list leaked
via the early return.
3. The threaded poll handler returned without re-enabling the interrupt
when the reply queue was already gone, leaving that interrupt line
permanently masked. It now re-enables it before returning.
4. Two other callers read the same pointer without a NULL check, which
could now be reached with a NULL value. Add the check at the single
point they both call through, and read the pointer consistently with
the writer above.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/patchset/20260626114109.43685-1-ranjan.kumar@broadcom.com?part=6
Closes: https://sashiko.dev/#/patchset/20260708183305.244485-1-ranjan.kumar@broadcom.com?part=6
Closes: https://sashiko.dev/#/patchset/20260724102505.115136-1-ranjan.kumar@broadcom.com?part=6
Closes: https://sashiko.dev/#/patchset/20260805110634.346670-1-ranjan.kumar@broadcom.com?part=6
Co-developed-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Signed-off-by: Ranjan Kumar <ranjan.kumar@broadcom.com>
Link: https://patch.msgid.link/20260916082705.44712-7-ranjan.kumar@broadcom.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
