Skip to content
Snippets Groups Projects
Commit 2053ad82 authored by Dan Carpenter's avatar Dan Carpenter Committed by Frieder Schrempf
Browse files

mmc: mmc_test: Fix NULL dereference on allocation failure


[ Upstream commit a1e627af ]

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: 2661081f ("mmc_test: highmem tests")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/8c90be28-67b4-4b0d-a105-034dc72a0b31@stanley.mountain


Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent e969bc82
No related branches found
No related tags found
1 merge request!167🤖 Sync Bot: Update v5.4-ktn to Latest Stable Kernel (v5.4.283)
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment