[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20210418143425.22944-2-egorenar-dev@posteo.net>
Date: Sun, 18 Apr 2021 14:34:25 +0000
From: Alexander Egorenkov <egorenar-dev@...teo.net>
To: linux-kernel@...r.kernel.org
Cc: Alexander Egorenkov <egorenar-dev@...teo.net>
Subject: [PATCH 2/2] lib: scatterlist: Fix incorrect SG offset in sg_split_phys()
sg_split_phys() incorrectly resets the offset of all split SGLs but the
first one to 0. This is wrong because one of the original SGLs might have
the offset != 0.
Signed-off-by: Alexander Egorenkov <egorenar-dev@...teo.net>
---
lib/sg_split.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/lib/sg_split.c b/lib/sg_split.c
index 0920affd12ee..4e91547a898d 100644
--- a/lib/sg_split.c
+++ b/lib/sg_split.c
@@ -89,8 +89,6 @@ static void sg_split_phys(struct sg_splitter *splitters, const int nb_splits)
if (!j) {
out_sg->offset += split->skip_sg0;
out_sg->length -= split->skip_sg0;
- } else {
- out_sg->offset = 0;
}
sg_dma_address(out_sg) = 0;
if (IS_ENABLED(CONFIG_NEED_SG_DMA_LENGTH))
--
2.31.1
Powered by blists - more mailing lists