Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c7f2f20 authored by Markus Elfring's avatar Markus Elfring Committed by Vinod Koul
Browse files

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: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent cf80ecf7
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -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;