mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-20 22:26:23 +00:00
scst_mem: Fix a memory leak triggered by the scst_user driver (merge r5829 from trunk)
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@5830 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
+7
-1
@@ -1021,7 +1021,13 @@ struct scatterlist *sgv_pool_alloc(struct sgv_pool *pool, unsigned int size,
|
||||
goto out_fail_free;
|
||||
}
|
||||
|
||||
TRACE_MEM("Brand new obj %p", obj);
|
||||
if (likely(!obj->recycling_list_entry.next)) {
|
||||
TRACE_MEM("Brand new obj %p", obj);
|
||||
} else if (unlikely(obj->sg_entries != obj->sg_entries_data)) {
|
||||
TRACE_MEM("Cached obj %p with sg_count == 0", obj);
|
||||
kfree(obj->sg_entries);
|
||||
obj->sg_entries = NULL;
|
||||
}
|
||||
|
||||
if (pages_to_alloc <= sgv_max_local_pages) {
|
||||
obj->sg_entries = obj->sg_entries_data;
|
||||
|
||||
Reference in New Issue
Block a user