ste_dma40: Return directly after a failed kmalloc_array()
authorMarkus Elfring <elfring@users.sourceforge.net>
Sat, 17 Sep 2016 06:21:30 +0000 (08:21 +0200)
committerVinod Koul <vinod.koul@intel.com>
Mon, 26 Sep 2016 17:36:16 +0000 (23:06 +0530)
Return directly after a memory allocation failed in this function
at the beginning.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/ste_dma40.c

index 156199d..b4dd591 100644 (file)
@@ -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;