From patchwork Sat Sep 17 15:08:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9337137 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E390F60839 for ; Sat, 17 Sep 2016 15:10:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D4CAD275A2 for ; Sat, 17 Sep 2016 15:10:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C988928C4E; Sat, 17 Sep 2016 15:10:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 59310275A2 for ; Sat, 17 Sep 2016 15:10:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1blHF5-0001P1-FO; Sat, 17 Sep 2016 15:09:23 +0000 Received: from mout.web.de ([212.227.17.11]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1blHEy-0001HY-OE for linux-arm-kernel@lists.infradead.org; Sat, 17 Sep 2016 15:09:17 +0000 Received: from [192.168.1.2] ([78.48.101.40]) by smtp.web.de (mrweb102) with ESMTPSA (Nemesis) id 0Mf0pJ-1bMi6t101Z-00Oa9u; Sat, 17 Sep 2016 17:08:50 +0200 Subject: [PATCH 02/24] ste_dma40: Return directly after a failed kmalloc_array() To: dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Dan Williams , Linus Walleij , Vinod Koul References: <566ABCD9.1060404@users.sourceforge.net> <92810066-69b6-94e7-dcec-a28594b1328f@users.sourceforge.net> From: SF Markus Elfring Message-ID: <9318d779-42d8-ad52-784d-1715439c209d@users.sourceforge.net> Date: Sat, 17 Sep 2016 17:08:49 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <92810066-69b6-94e7-dcec-a28594b1328f@users.sourceforge.net> X-Provags-ID: V03:K0:WWLPXIHWUQlF5m9e9i5npNUopM/D5r3+1kwV8txbabNX27DUak2 DdlV/jsAn2fucjB+OfrLFx+hmrrN3EYT/SnKUcfXoAsZBWgTDTtGYipuANGFtFOCcgORq4e 6tZu3y3DJ00ES7DdLIpKxafUmShSqW0EioU7otTlA0dumaRJHRb1ZI+uUVywSUHeSRp52lS dAsiyP+l53s1t+Dipt3dQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:eAqU8+nQ7AY=:chRV5GKP3RJliCoPqlTnsC uuIIlxJkwfM4//JiF2S6nWlAD+4Tz2sTVyi3uJsd2djQYB+v022v+cWMMuZ42CVTdlGuPnI/Y /14DOuNCfTIdEjmQhp6w0B0AyEtvheDTqGrsgvSgtusqt7bUE7HRzVT3J8MV8LZhTuaGs5wGG 5meobfPPtIBN1Vti3VpO6c8FVIhXCaPOslbwR3bOX+iP99lH9Id+pJQBJINcBboknTp15Dh4L 1dlRx4rnGkCmJ0Jfj2j1iLXKjEuBQbC672hyxbKnpn0f4Oo9VgfVlyS92MhJE+gVBDqPME38J R+XlIGkvDrZ/+KwWfrq7v0Fy075nEdqizthNCk0DVJ2xht9rGdlDiODp9Q4wZho0itigzXCU0 3M4NSTIoXG/eaeAXZKLDZcOZuapuev9ITzDijmVekqM7oWGE49PMe+Kh7IsXHBzRc+Aqfvj8v vPnjBhMRLxMD4lZK4uVjoFMm9gaHltjl8oGWts/uK1vl7r5uF/XmQScB2qo9N5qj7b104NAlF eMyer/whwIqijVw0OW5BtAdxhfPChw3bGFnuivJWpRrEWf+RmHQrUaRBFLDaR3x1i0pUig2Eg ftEr2JpLo8MfYnknsYvCrTdq+nzvP8IBbTaKpB8N+JKAqzAexI00CFi6Ypdo7S1hcwHUqMBSM 7ZBClYk2UxqyvonuOnvWUffMk8/YN3yyyDWCJqk8ztjbGO+zjmxxaJhsEYfWKUwWeUrkX1La+ JhYLvpl0FoY5WaLZtsXrAvue9IxSkDJZEVsBSl/w388UIgGG8XQJCgeOt9ooleAs8FPCzt5aA EYIVnxS X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160917_080917_242402_2C36B71A X-CRM114-Status: UNSURE ( 9.68 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Julia Lawall , kernel-janitors@vger.kernel.org, LKML Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sat, 17 Sep 2016 08:21:30 +0200 Return directly after a memory allocation failed in this function at the beginning. Signed-off-by: Markus Elfring --- drivers/dma/ste_dma40.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index fbebeff..80a199a 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -3412,10 +3412,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;