mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexander Egorenkov <egorenar-dev@posteo.net>
To: linux-kernel@vger.kernel.org
Cc: Alexander Egorenkov <egorenar-dev@posteo.net>
Subject: [PATCH 2/2] lib: scatterlist: Fix incorrect SG offset in sg_split_phys()
Date: Sun, 18 Apr 2021 14:34:25 +0000	[thread overview]
Message-ID: <20210418143425.22944-2-egorenar-dev@posteo.net> (raw)
In-Reply-To: <20210418143425.22944-1-egorenar-dev@posteo.net>

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@posteo.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


      reply	other threads:[~2021-04-18 14:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-18 14:34 [PATCH 1/2] lib: scatterlist: Fix loop termination condition in sg_calculate_split() Alexander Egorenkov
2021-04-18 14:34 ` Alexander Egorenkov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210418143425.22944-2-egorenar-dev@posteo.net \
    --to=egorenar-dev@posteo.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®