]> Git Repo - J-linux.git/commit
mmc: mmc_test: Fix NULL dereference on allocation failure
authorDan Carpenter <[email protected]>
Tue, 20 Aug 2024 08:44:08 +0000 (11:44 +0300)
committerUlf Hansson <[email protected]>
Tue, 20 Aug 2024 11:47:36 +0000 (13:47 +0200)
commita1e627af32ed60713941cbfc8075d44cad07f6dd
tree773e7ecbd92375991974b84283bfcd79b85c5081
parent6275c7bc8dd07644ea8142a1773d826800f0f3f7
mmc: mmc_test: Fix NULL dereference on allocation failure

If the "test->highmem = alloc_pages()" allocation fails then calling
__free_pages(test->highmem) will result in a NULL dereference.  Also
change the error code to -ENOMEM instead of returning success.

Fixes: 2661081f5ab9 ("mmc_test: highmem tests")
Signed-off-by: Dan Carpenter <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Ulf Hansson <[email protected]>
drivers/mmc/core/mmc_test.c
This page took 0.042548 seconds and 4 git commands to generate.