From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B07DC433ED for ; Sun, 18 Apr 2021 14:36:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1136A610E9 for ; Sun, 18 Apr 2021 14:36:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231680AbhDROfJ (ORCPT ); Sun, 18 Apr 2021 10:35:09 -0400 Received: from mout01.posteo.de ([185.67.36.65]:48219 "EHLO mout01.posteo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230330AbhDROfD (ORCPT ); Sun, 18 Apr 2021 10:35:03 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 790D324002A for ; Sun, 18 Apr 2021 16:34:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1618756472; bh=6thETMQGh49GaIIDorZhPjhkpw8s8DkGoYxt2KGTNJs=; h=From:To:Cc:Subject:Date:From; b=HuZKdXOIJm5aM6l/agjb7y4y8M75UHTrW7MclLEsaaRJL2qxxm7kB8vdDA/gXfF+A +qN8YtkqQNsmJQ68ujAI1+R2/qPdwqlAQDiXzWTh6tm7ru4uM3qC3XssaK3fVKa7nc H7C95zHEpy0SLKH3Fi8Sr4j4kNKdzApkN4l1r7ckCL8tQ1XRkhzhEklt6hHhIElNfL eDgORgozZ4byTHGBWnvXz1kbW3hXYFvlrKk8n7cE2KJlnwT8AIuDAWD+NpRsaKs8Og 1u/JTHPdMCqCp+muy9POvJ1lfNVuHnJXnOR7SOWJH/s74+EsMFuZQJZrqx/qqY4p3C VsQM1LV3UrrGA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FNXX767qBz6tmP; Sun, 18 Apr 2021 16:34:31 +0200 (CEST) From: Alexander Egorenkov To: linux-kernel@vger.kernel.org Cc: Alexander Egorenkov Subject: [PATCH 2/2] lib: scatterlist: Fix incorrect SG offset in sg_split_phys() Date: Sun, 18 Apr 2021 14:34:25 +0000 Message-Id: <20210418143425.22944-2-egorenar-dev@posteo.net> In-Reply-To: <20210418143425.22944-1-egorenar-dev@posteo.net> References: <20210418143425.22944-1-egorenar-dev@posteo.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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