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: 9337125 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 2B67860839 for ; Sat, 17 Sep 2016 15:09:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BF9528BBC for ; Sat, 17 Sep 2016 15:09:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1068028BC0; Sat, 17 Sep 2016 15:09:23 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BDC0928BBC for ; Sat, 17 Sep 2016 15:09:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751970AbcIQPJV (ORCPT ); Sat, 17 Sep 2016 11:09:21 -0400 Received: from mout.web.de ([212.227.17.11]:55970 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751304AbcIQPJU (ORCPT ); Sat, 17 Sep 2016 11:09:20 -0400 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> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall 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 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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;