]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mmc: mvsdio: Fix dma_unmap_sg() nents value
authorThomas Fourier <fourier.thomas@gmail.com>
Tue, 26 Aug 2025 07:58:08 +0000 (09:58 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Fri, 12 Sep 2025 12:04:22 +0000 (14:04 +0200)
The dma_unmap_sg() functions should be called with the same nents as the
dma_map_sg(), not the value the map function returned.

Fixes: 236caa7cc351 ("mmc: SDIO driver for Marvell SoCs")
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/mvsdio.c

index a9e6277789ba69afffd1755ef081ba4f1209f41d..79df2fa89a3fdd1f77443a97cfef26b68f9d42b3 100644 (file)
@@ -292,7 +292,7 @@ static u32 mvsd_finish_data(struct mvsd_host *host, struct mmc_data *data,
                host->pio_ptr = NULL;
                host->pio_size = 0;
        } else {
-               dma_unmap_sg(mmc_dev(host->mmc), data->sg, host->sg_frags,
+               dma_unmap_sg(mmc_dev(host->mmc), data->sg, data->sg_len,
                             mmc_get_dma_dir(data));
        }