Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4262572rdb; Thu, 14 Sep 2023 17:50:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFFvY9Enw63xXXvPGESwW/fR2GE6U7wVQZgDa+EPMGZoZKvKTFvkts10NF3VHvFbLm+Br4d X-Received: by 2002:a17:90a:ea8a:b0:274:726d:7914 with SMTP id h10-20020a17090aea8a00b00274726d7914mr83861pjz.47.1694739038390; Thu, 14 Sep 2023 17:50:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694739038; cv=none; d=google.com; s=arc-20160816; b=UXv8GDRDxTsM/WTZfKwtG2h3JWENr+GssQJJ/HnayEzp0TSb3hf/G9JJBcs5XW73vy /FOIHdsEDwXw3adqWjkdGEuQMMgsJyLRGI+eQbNs17f1Y+FQ5eqvoMpsXnxqwzYqcFHX BT2nwdarvNBm1PQ4OeXeRqs667MiYcIDuIfhzwgjyxQczS4SVN/kjw04IA39U567q1xV 5whktqs5ZTIojgdZ1IJWIiqd2UKFqjI40ajoAremJrb1fRs+iV2f6JwkxcP7EL6l3Og6 1jv98pHT0hSmZPQ8BUFkYUFr1xEkFzeBaF+RMCZcTy1AWWo9pRd7ngAl3TdG3lYRV2yt MhNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:to:from:dkim-signature; bh=nad9A/VbKdrfPZunawFnPzLWs8iZM5+zMuaqAp2Hnrg=; fh=13wLQrcnqzfndfK78r0+/apZx6umXA5Pe5KxM/TWa1k=; b=kbSSc/RTHBmF8K85Kze+JblQocXzu5kn8HSw/APJxVf4pPpItJ8Xx7bVmNhVmpz85r bHnGwBLxTYdRNuPhfToY6qTSs2PJE8oP52UfHG9ntqG7kBBGqFlckTYl8Y//xDySW4fQ QW08BFL0yzOs3qKR0diVMbbFEDoQEr8Db3b26aHrAD3CABAGUM5FTWpdtzjywXz+2Q/g z6Rox4krwFLyQTZneh7E/ekpqxNANd3axOijp2qwLioBpgMH+BDiSI76ni1VREAmsqWr +tjIXeKBsbEHefT1J7IfH+tvbmzkqAAXjMn8RyRA58qw5Ss2Yg99genaylb7h5+WR1X6 vHwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=GB0JMoZJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id np9-20020a17090b4c4900b00273fde2471esi5140481pjb.88.2023.09.14.17.50.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 17:50:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=GB0JMoZJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 23B3783D7CB2; Thu, 14 Sep 2023 17:50:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230525AbjIOAue (ORCPT + 99 others); Thu, 14 Sep 2023 20:50:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230153AbjIOAue (ORCPT ); Thu, 14 Sep 2023 20:50:34 -0400 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA6EB26B8 for ; Thu, 14 Sep 2023 17:50:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1694739028; bh=nad9A/VbKdrfPZunawFnPzLWs8iZM5+zMuaqAp2Hnrg=; h=From:To:Subject:In-Reply-To:References:Date:From; b=GB0JMoZJMVmdf+EG39aOaj0qRSqX2rMiFxtPMzpdQqOzqowiBYyCBBXMNMD/9BuWT hTFErFF4BaLXcjc4qRQ/7PQBFd38/jrn2PyHXUhetRzyigML/7pASAGwTwnwCv8Cj+ uNXOX3YfCfRl+qNN9oU4ExH4XDEUkHnrWVt1Xay8tHoAZXf515bNBjZ5XUtAsBOXjN 1aJOVoIASQbmF1EOf40TtKIntpwkXEPTPONRgX9xjvS7GCrDO8nmVLOnlNZ+7QoE0o zOeG7Nhmec3QTAe7n0FMc7aCDnlIKzSrD2QPVpSXXMlO2Xw4EW1t6YztjAhKzt2Lcg DHsksg7ag605A== Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4Rmwb83wdgz4x2b; Fri, 15 Sep 2023 10:50:28 +1000 (AEST) From: Michael Ellerman To: Tyrel Datwyler , Yuanjun Gong , Nicholas Piggin , Christophe Leroy , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] powerpc: fix a memory leak In-Reply-To: <54bf92e8-f884-1567-2149-caf638ff8f68@linux.ibm.com> References: <20230914094620.3379729-1-ruc_gongyuanjun@163.com> <54bf92e8-f884-1567-2149-caf638ff8f68@linux.ibm.com> Date: Fri, 15 Sep 2023 10:50:28 +1000 Message-ID: <87il8c6yzv.fsf@mail.lhotse> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 14 Sep 2023 17:50:35 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Tyrel Datwyler writes: > On 9/14/23 02:46, Yuanjun Gong wrote: >> When one of the methods xive_native_alloc_irq_on_chip, irq_create_mapping >> or irq_get_handler_data fails, the function will directly return without >> disposing vinst->name and vinst. Fix it. >> >> Fixes: c20e1e299d93 ("powerpc/vas: Alloc and setup IRQ and trigger port address") >> Signed-off-by: Yuanjun Gong >> --- >> arch/powerpc/platforms/powernv/vas.c | 14 +++++++++----- >> 1 file changed, 9 insertions(+), 5 deletions(-) >> >> diff --git a/arch/powerpc/platforms/powernv/vas.c b/arch/powerpc/platforms/powernv/vas.c >> index b65256a63e87..780740b478f0 100644 >> --- a/arch/powerpc/platforms/powernv/vas.c >> +++ b/arch/powerpc/platforms/powernv/vas.c >> @@ -54,7 +54,7 @@ static int init_vas_instance(struct platform_device *pdev) >> struct xive_irq_data *xd; >> uint32_t chipid, hwirq; >> struct resource *res; >> - int rc, cpu, vasid; >> + int rc, cpu, vasid, ret; > > You can you reuse rc for the return value in the error path instead of > introducing a new ret variable. Yep, please send a v2. cheers