]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
tools/testing/scatterlist: Fix overflow of max segment size
authorMaor Gottlieb <maorg@nvidia.com>
Mon, 25 Jan 2021 12:05:27 +0000 (14:05 +0200)
committerAndrea Righi <andrea.righi@canonical.com>
Mon, 15 Mar 2021 14:09:21 +0000 (15:09 +0100)
[ Upstream commit 96667052149da3855c4361925324b690c687152f ]

Because SCATTERLIST_MAX_SEGMENT was removed and replaced with UINT_MAX,
the test overflows the max_sgement variable. Remove this case.

Fixes: 7a60c2dd0f57 ("drm: Remove SCATTERLIST_MAX_SEGMENT")
Link: https://lore.kernel.org/r/20210125120527.836363-1-leon@kernel.org
Signed-off-by: Maor Gottlieb <maorg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
tools/testing/scatterlist/main.c

index 71c960dcd8a42fae5bbaf3d66418eb2d6d0ef465..652254754b4cb800859943d04322f9432d35d0c6 100644 (file)
@@ -55,7 +55,6 @@ int main(void)
        struct test *test, tests[] = {
                { -EINVAL, 1, pfn(0), NULL, PAGE_SIZE, 0, 1 },
                { 0, 1, pfn(0), NULL, PAGE_SIZE, PAGE_SIZE + 1, 1 },
-               { 0, 1, pfn(0), NULL, PAGE_SIZE, sgmax + 1, 1 },
                { 0, 1, pfn(0), NULL, PAGE_SIZE, sgmax, 1 },
                { 0, 1, pfn(0), NULL, 1, sgmax, 1 },
                { 0, 2, pfn(0, 1), NULL, 2 * PAGE_SIZE, sgmax, 1 },