* [PATCH] lib/scatterlist: fix memory leak with scsi-mq
@ 2014-10-23 19:10 Tony Battersby
2014-10-24 9:25 ` Christoph Hellwig
2014-10-28 0:07 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Tony Battersby @ 2014-10-23 19:10 UTC (permalink / raw)
To: linux-scsi, James E.J. Bottomley, Jens Axboe
Cc: linux-kernel, Christoph Hellwig
Fix a memory leak with scsi-mq triggered by commands with large data
transfer length.
Fixes: c53c6d6a68b1 ("scatterlist: allow chaining to preallocated chunks")
Cc: <stable@vger.kernel.org> # 3.17.x
Signed-off-by: Tony Battersby <tonyb@cybernetics.com>
---
For inclusion in 3.18 and 3.17.x.
--- a/lib/scatterlist.c 2014-10-23 13:32:27.000000000 -0400
+++ b/lib/scatterlist.c 2014-10-23 13:32:36.000000000 -0400
@@ -203,10 +203,10 @@ void __sg_free_table(struct sg_table *ta
}
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;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] lib/scatterlist: fix memory leak with scsi-mq
2014-10-23 19:10 [PATCH] lib/scatterlist: fix memory leak with scsi-mq Tony Battersby
@ 2014-10-24 9:25 ` Christoph Hellwig
2014-10-28 0:07 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2014-10-24 9:25 UTC (permalink / raw)
To: Tony Battersby
Cc: linux-scsi, James E.J. Bottomley, Jens Axboe, linux-kernel,
Christoph Hellwig
On Thu, Oct 23, 2014 at 03:10:21PM -0400, Tony Battersby wrote:
> Fix a memory leak with scsi-mq triggered by commands with large data
> transfer length.
Thanks, this was indeed caused by a last minute change due to someone
complaining about my earlier version being a little too convoluted.
Thanks for tracking this down!
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] lib/scatterlist: fix memory leak with scsi-mq
2014-10-23 19:10 [PATCH] lib/scatterlist: fix memory leak with scsi-mq Tony Battersby
2014-10-24 9:25 ` Christoph Hellwig
@ 2014-10-28 0:07 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2014-10-28 0:07 UTC (permalink / raw)
To: Tony Battersby
Cc: linux-scsi, James E.J. Bottomley, Jens Axboe, linux-kernel,
Christoph Hellwig
>>>>> "Tony" == Tony Battersby <tonyb@cybernetics.com> writes:
Tony> Fix a memory leak with scsi-mq triggered by commands with large
Tony> data transfer length.
Tony> Fixes: c53c6d6a68b1 ("scatterlist: allow chaining to preallocated
Tony> chunks")
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-10-28 0:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-23 19:10 [PATCH] lib/scatterlist: fix memory leak with scsi-mq Tony Battersby
2014-10-24 9:25 ` Christoph Hellwig
2014-10-28 0:07 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox