提交 c21e59d8 编写于 作者: T Tony Battersby 提交者: Jens Axboe

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: NTony Battersby <tonyb@cybernetics.com>
Reviewed-by: NMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: NJens Axboe <axboe@fb.com>
上级 d32f6b57
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册