From: Stefan Wahren Date: Thu, 25 May 2017 22:26:17 +0000 (+0200) Subject: staging: vchiq_2835_arm: Handle vmalloc_to_page error case X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=025f69ade93952e9415ea5c5f48d729b03e04dfc;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git staging: vchiq_2835_arm: Handle vmalloc_to_page error case In case vmalloc_to_page returns NULL create_pagelist must abort imediatly. Signed-off-by: Stefan Wahren Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c index 8911e86a2cce..eeeee1bf68b7 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c @@ -459,6 +459,11 @@ create_pagelist(char __user *buf, size_t count, unsigned short type, PAGE_SIZE)); size_t bytes = PAGE_SIZE - off; + if (!pg) { + cleanup_pagelistinfo(pagelistinfo); + return NULL; + } + if (bytes > length) bytes = length; pages[actual_pages] = pg;