From: Markus Elfring Date: Sat, 17 Sep 2016 06:21:30 +0000 (+0200) Subject: ste_dma40: Return directly after a failed kmalloc_array() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2c7f2f20da9d3fe13ed08d1661ebc12d4ce0cab9;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ste_dma40: Return directly after a failed kmalloc_array() Return directly after a memory allocation failed in this function at the beginning. Signed-off-by: Markus Elfring Reviewed-by: Linus Walleij Signed-off-by: Vinod Koul --- diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 156199d168bf..b4dd5910ffb1 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -3414,10 +3414,8 @@ static int __init d40_lcla_allocate(struct d40_base *base) page_list = kmalloc_array(MAX_LCLA_ALLOC_ATTEMPTS, sizeof(*page_list), GFP_KERNEL); - if (!page_list) { - ret = -ENOMEM; - goto failure; - } + if (!page_list) + return -ENOMEM; /* Calculating how many pages that are required */ base->lcla_pool.pages = SZ_1K * base->num_phy_chans / PAGE_SIZE;