From patchwork Thu Sep 22 17:42:12 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: 9346073 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 11E58607D0 for ; Thu, 22 Sep 2016 17:42:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0AD1B2AC08 for ; Thu, 22 Sep 2016 17:42:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F37DC2AC0A; Thu, 22 Sep 2016 17:42:18 +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=-3.7 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM 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 AFA262AC08 for ; Thu, 22 Sep 2016 17:42:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 090766E91A; Thu, 22 Sep 2016 17:42:18 +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.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4C5CC6E91A for ; Thu, 22 Sep 2016 17:42:16 +0000 (UTC) Received: from [192.168.1.2] ([77.182.99.72]) by smtp.web.de (mrweb002) with ESMTPSA (Nemesis) id 0MIvFp-1bpbv20p9F-002Z37; Thu, 22 Sep 2016 19:42:13 +0200 Subject: [PATCH 10/14] GPU-DRM-TTM: Return directly after a failed kobject_init_and_add() 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: <94a74055-0608-60f2-ce14-61b99abc5170@users.sourceforge.net> Date: Thu, 22 Sep 2016 19:42:12 +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:X3G1rKbvTip72TWi8gbtMJUz5wF2Jrru9iMESQ/mLUfCaoQplL2 N/ErBimRdxrlxPLVYGjy2ESgNWRxGo79HUGPjyiND8Xb+yUOB8NaRxjvNbx4T0nbNw4n5Rj rs5f4cOmDiQjI9s56IjQS8LWgWPFHhgOO2bTs4JX7RDsfQQAfks8PesoXW5g4EPgIewvqqo 2cRT2iBcRBHIor9n2wYYQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:Drnpc1Y6W7M=:7bhCoo5Aln4hJrpIs0wH5F 7hOQMVpv+x+nea1/IQnyBEIeKhX7+Kr0LrGRt545V8dzptjm5If842oh9I9zjfIT8K1SRqOI4 lCfp2AKmofay4WYczEDivF6xk0vNjwYZrY274G9W0Bh+fh5YtG9qFik5+UWVgK65+sUDUdUdo bUqyQmXjTWLMMC8lr6ZBKsscITWsXrOv9t6ZwLZXQYKpbM2yi6f1J16hUkVjnjRuaK+EEWfG0 yx0sIXDla8XBkCYPBeYbW25ntM+9EfyrZfWGh+QlmUBHcxY8BwZXFi1Fso3TKrCkxMfqBS/A9 gDx+/bm/jIV1NopiWjLIOP4Z5zW/U63BUrPBcqj1+9QSRjt02ZkAg97LhOTkpBAQbZEWUD1El hbc9zCU5wUuyQAFXH1gUdCSAYTgu81jSEKxnzu35zYZs9SKvoIQa++d77pDkOAWQBSL2THSpB zq2+68YDS45V6/ZMI/PqkhRQ5DZkd2mAbIWibyKPkVxrqSpjU1pS/i5RT8dkAAnaOL6U1QVgu A22djTCavI02C/6kaaA+1azm1x/hy/OGgzcWlflFOTAnrpEkkapq6Sx3HT8HmYclRcT0edndP pHbLz6CGLQkwOOoALvidNrZ/Cq7KaV70mdPxDYC2ApCGGM94InXMXr/Zp0Olnuq9VWzqD46IQ UF8Q6ylk0eX+B4WUdRjbxCzJSzm5tuEfYaq/oIS3oIFiNVnEEiNDLTpF53iIe8frXK/f+KN8Z RWl3P1jjQY1HtG8C5uX6MHfqnBTXtDmOfLogEDyr1V34YyfrIZx6E5bKGGElhd4/j+Tq1wulV 6rL8iE9 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:24:43 +0200 * Return directly after a call of the function "kobject_init_and_add" failed here. * Delete the jump target "err" which became unnecessary with this refactoring. Signed-off-by: Markus Elfring --- drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c index feba278..c21f45f 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c @@ -1102,12 +1102,10 @@ int ttm_dma_page_alloc_init(struct ttm_mem_global *glob, unsigned max_pages) &glob->kobj, "dma_pool"); if (unlikely(ret != 0)) { kobject_put(&_manager->kobj); - goto err; + return ret; } ttm_dma_pool_mm_shrink_init(_manager); return 0; -err: - return ret; } void ttm_dma_page_alloc_fini(void)