X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=lib%2Fscatterlist.c;h=c9f2e8c6ccc996c8a40bac6872749185170ec7f9;hb=e899dbaf4898efdaf6d1a02ed4ac205d35f54df8;hp=9cdf62f8accdeaf777e8661ba51e3c08617ad06e;hpb=0dc0d9e18e7d4076440bdab73410cdfc1337586a;p=cascardo%2Flinux.git diff --git a/lib/scatterlist.c b/lib/scatterlist.c index 9cdf62f8accd..c9f2e8c6ccc9 100644 --- a/lib/scatterlist.c +++ b/lib/scatterlist.c @@ -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; }