Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1794927ybv; Sat, 8 Feb 2020 06:10:29 -0800 (PST) X-Google-Smtp-Source: APXvYqxZdD4madQ4lvvNALNYU4FXIPawBbA4I/N91zR4hAD3vJ2j9WGNJ++6DRa1gJB1l4a6nJba X-Received: by 2002:a9d:6ac2:: with SMTP id m2mr3584929otq.191.1581171028933; Sat, 08 Feb 2020 06:10:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581171028; cv=none; d=google.com; s=arc-20160816; b=q+DHiQ8p46HbfjvpZ6MLPKvESLTN1R9pEdzWKj0gu5FqRJJK7SRXfBC8+8BOCDuc/J wS6P93WLJP16veDC4FAW5Uk3Lvve6aFqCM9O6JkHoach9n8BG9szSDsBqTJs66DIf+D7 xEcSGrWJ4tnGDvmufcln2LHAy5eIYCIwbEFfxEjJNFwm0gUG8aO0Gw0sJzS5/s9FTEUW yIAzObPNlv5r+TFSPJ5ZxSo08+DJxlcZ9mjbmT19FE4m65dXa/RH5km7eIjMXtE1LuJQ osNrlPmtEYg2+aLjaKR8qXu3IA4pCghzlIJK+mkXnccpmk1AQsRUaf4F1kxZFwMFbukA RuFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=8au0dWam1ANQkc8e1i4gMz31LnPtS4WMMMrnkOPYhBw=; b=BqDj1vTHGwabG+chGW0EqmyMh8ZhQEQbro5EUCl2NwmPVcbsT+TnU2TYJ+cPaAI/7f GdnFHERpIXywJg/vJzyrHOv+PGL7kEDlCNrjy3h1l+EQADx1VmgCOH1Rya00H1pfKAQN Qj0gAaDsMvJ+5cX+eOb3zKRQqlbFFTVxpqo+aEKJPsGh6mpsU2j3pzh8rsnkFm6fS1xU ffkqv1qlIhp7kCR5m0yoGoezrlkfcjWFS/4tSiTaqsciIJuqJBZzfjpxGaxqibdP2fck jPn+ox1O6WKI90YJnQcpSLWih4Mqz2zzCpOFsgeZCbdJ2uHuFrH/iXDuclGc59EnA8ak dbBA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g5si1620312otn.232.2020.02.08.06.10.17; Sat, 08 Feb 2020 06:10:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727387AbgBHOJ2 (ORCPT + 99 others); Sat, 8 Feb 2020 09:09:28 -0500 Received: from smtp08.smtpout.orange.fr ([80.12.242.130]:38074 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727195AbgBHOJ1 (ORCPT ); Sat, 8 Feb 2020 09:09:27 -0500 Received: from localhost.localdomain ([93.22.133.23]) by mwinf5d31 with ME id 0E9R220070WSqZ103E9RbC; Sat, 08 Feb 2020 15:09:26 +0100 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 08 Feb 2020 15:09:26 +0100 X-ME-IP: 93.22.133.23 From: Christophe JAILLET To: oss@buserror.net, galak@kernel.crashing.org, benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 2/2] powerpc/83xx: Add some error handling in 'quirk_mpc8360e_qe_enet10()' Date: Sat, 8 Feb 2020 15:09:20 +0100 Message-Id: <20200208140920.7652-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In some error handling path, we should call "of_node_put(np_par)" or some resource may be leaking in case of error. Fixes: 8159df72d43e ("83xx: add support for the kmeter1 board.") Signed-off-by: Christophe JAILLET --- arch/powerpc/platforms/83xx/km83xx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/83xx/km83xx.c b/arch/powerpc/platforms/83xx/km83xx.c index 306be75faec7..bcdc2c203ec9 100644 --- a/arch/powerpc/platforms/83xx/km83xx.c +++ b/arch/powerpc/platforms/83xx/km83xx.c @@ -60,10 +60,12 @@ static void quirk_mpc8360e_qe_enet10(void) ret = of_address_to_resource(np_par, 0, &res); if (ret) { pr_warn("%s couldn't map par_io registers\n", __func__); - return; + goto out; } base = ioremap(res.start, resource_size(&res)); + if (!base) + goto out; /* * set output delay adjustments to default values according @@ -111,6 +113,7 @@ static void quirk_mpc8360e_qe_enet10(void) setbits32((base + 0xac), 0x0000c000); } iounmap(base); +out: of_node_put(np_par); } -- 2.20.1