mmc: test: Fix potential __free_pages(NULL) in mmc_test
PATCH 1/1 mmc: test: Fix potential __free_pages(NULL) in mmc_test
alloc_pages() can return NULL, in which case we'll pass NULL to __free_pages().
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=78391
Reported-by RUC_SoftSec <[email protected]>
Signed-off-by Chris Ball <[email protected]>
--- drivers/mmc/card/mmc_test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mmc/card/mmc_test.c +2 -1
@@ -2884,7 +2884,8 @@ static ssize_t mtf_test_write(struct file *file, const char __user *buf, }#ifdef CONFIG_HIGHMEM -__free_pages (test->highmem,BUFFER_ORDER ); +if (test->highmem) +__free_pages (test->highmem,BUFFER_ORDER );#endif kfree (test->buffer);kfree (test);
Signature · 1 line
Chris Ball <http://printf.net/>