Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c21e59d8 authored by Tony Battersby's avatar Tony Battersby Committed by Jens Axboe
Browse files

lib/scatterlist: fix memory leak with scsi-mq



Fix a memory leak with scsi-mq triggered by commands with large data
transfer length.

Fixes: c53c6d6a ("scatterlist: allow chaining to preallocated chunks")
Cc: <stable@vger.kernel.org> # 3.17.x
Signed-off-by: default avatarTony Battersby <tonyb@cybernetics.com>
Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent d32f6b57
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -203,10 +203,10 @@ void __sg_free_table(struct sg_table *table, unsigned int max_ents,
		}

		table->orig_nents -= sg_size;
		if (!skip_first_chunk) {
			free_fn(sgl, alloc_size);
		if (skip_first_chunk)
			skip_first_chunk = false;
		}
		else
			free_fn(sgl, alloc_size);
		sgl = next;
	}