From patchwork Thu Sep 22 17:41:20 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: 9346063 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 A114360B16 for ; Thu, 22 Sep 2016 17:41:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9846E2AC05 for ; Thu, 22 Sep 2016 17:41:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8D13C2AC06; Thu, 22 Sep 2016 17:41:27 +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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 47D312AC08 for ; Thu, 22 Sep 2016 17:41:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 84D6D6E919; Thu, 22 Sep 2016 17:41:26 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.web.de (mout.web.de [212.227.15.4]) by gabe.freedesktop.org (Postfix) with ESMTPS id E56A46E919 for ; Thu, 22 Sep 2016 17:41:24 +0000 (UTC) Received: from [192.168.1.2] ([77.182.99.72]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0Mhljf-1banmU2C95-00MusT; Thu, 22 Sep 2016 19:41:21 +0200 Subject: [PATCH 09/14] GPU-DRM-TTM: Return directly after a failed kzalloc() in ttm_dma_page_alloc_init() To: dri-devel@lists.freedesktop.org, Daniel Vetter , David Airlie , Emil Velikov References: <566ABCD9.1060404@users.sourceforge.net> <4d34446f-05ad-c3ce-5d33-8fb4f25af25c@users.sourceforge.net> From: SF Markus Elfring Message-ID: <30cd1943-7762-65b7-4307-39ae0acdf699@users.sourceforge.net> Date: Thu, 22 Sep 2016 19:41:20 +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: <4d34446f-05ad-c3ce-5d33-8fb4f25af25c@users.sourceforge.net> X-Provags-ID: V03:K0:Iw15nIMYZPek+qhlptgHfU/cf6VznkylcOXsFJwJ8upiQZU0X/S +IQpTozuF6u9IizPWVa/XI5xSoR6KyNJR6WswMcA7m/KS9SQIFDxQSMjzS6on3+E5VKqyBX Nbr4XJ0xqgPioPTlbvxpAK3mHwhFTedUuY8W4EoGYflmIWPBXh+L6pK1dl1DH4sHTv4DwMi 5BXus20z/o4PN4DPDIAsw== X-UI-Out-Filterresults: notjunk:1; V01:K0:yHU3yPHjcGk=:TfzgbmwN0BfWkKlrQR8fSw 26SoI8aLgDz9tGOuVtnRuzBZlqUeV/el1oudn5abpxklSvevPB0PaZfxzyTqccWemXIlo32e2 uP+kq3vgjH/hISPrDyRWlR6uQjO5ntQpoJfQ8mFnXREQ66LxeepZSGfcLC4MfCw02olxJnM0O 9ZsWdOIW+U2yywfszjuz7s1cGz712MON077lT5loYJXQsxnxHkKhPCEKR3FWgzktYhw06ItFZ 4hNemRAUPQ1HWUeRFLTiooFN6CFKkVGtBMHN4qQl6QAKw3rD2udvYlv9EWcUpWUS+WR0PifuZ ku+gWP/YGs9B/nhRETjCjDmlfA6Nlb7NI3D23kC3rAgCkc/dE2MkH8yXbosrVvIq4KV0KTlJa 9DkregnuP15VEhl2DONTfDbX3KzTdaNNGSxEWaGFymylpP9+Jw0/P0syY47FkfpSnL52TBh/n 3Grue4aYcMDQff3a95+Yf9S1o86WEjSi7quxxPYArpdjpE1k5UjgGQD+8OD0UB8atQm60kwg+ nEGzh5Inwxd4ulAn9JAGbnBG1zdrhrbmQC1PKZrGvLZnAo9y0c1oM5UlfuUgl/X3TetC/XTQJ Ox+nhlkY6acJ9PhoSaf76rjC23kOygJknFwv/7F1mjOlTCSBLcw1S9tPjGI20jdE+Jfn8vRMq 5J7JlPgU43sJxsaSre7V3DS1an4ZbRbofDksTPk9mJLZetpvnT1TrhPuk5J/V+kCUUsxiEzls Wt8AhtKox79RB/px7LGDOaOipjIC8qLOtGU77WdTfedOD7XH1er1v383BEyaqBUv+up24atun HBzELMQ Cc: Julia Lawall , kernel-janitors@vger.kernel.org, LKML X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Thu, 22 Sep 2016 16:16:36 +0200 * Return directly after a memory allocation failed in this function at the beginning. * Delete the explicit initialisation for the local variable "ret" which became unnecessary with this refactoring. Signed-off-by: Markus Elfring --- drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c index e3f5542..feba278 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c @@ -1080,7 +1080,7 @@ static void ttm_dma_pool_mm_shrink_fini(struct ttm_pool_manager *manager) int ttm_dma_page_alloc_init(struct ttm_mem_global *glob, unsigned max_pages) { - int ret = -ENOMEM; + int ret; WARN_ON(_manager); @@ -1088,7 +1088,7 @@ int ttm_dma_page_alloc_init(struct ttm_mem_global *glob, unsigned max_pages) _manager = kzalloc(sizeof(*_manager), GFP_KERNEL); if (!_manager) - goto err; + return -ENOMEM; mutex_init(&_manager->lock); INIT_LIST_HEAD(&_manager->pools);