Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1308608yba; Tue, 2 Apr 2019 06:36:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqx/WvTtpByVqKAWi7EVlf044HKUmS3QAAS4Tajzei2mZPHt2n8gpdv2kem1XyUXqlXXtjyt X-Received: by 2002:a63:5a47:: with SMTP id k7mr62346391pgm.174.1554212202610; Tue, 02 Apr 2019 06:36:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554212202; cv=none; d=google.com; s=arc-20160816; b=fgBt4DhJM0GwPcUoJybYG5jrn8HlcxNVjKtWfNTS/Si7YvKsCK5zqKwTzQYJl8vuGB Y5uF/MwRAljC3HdJiTP/jBgT8rVsLOReIf9Jzd6m9/laBdw5x84c+EqXyyoNaT8jiZld r4C1P9rFGBlrwMvGH7QIvUKb/ozWUnrglxB0w1ohhYdGDfe+QFCFhkkenfPTzUNfg1Kz xoxx+mO6Ct4gSPXUD2Leo0p6QWXRkPHHZdbAAA7FS/2k4jDWkfs6oWaKG1A3LCYTcASs aZ7roKo7M/wD2y36NyWCfWA13L+UlhHGDVgGaFMUyAC3MVjhAt9wQiGyZpB9ypiycchf IMTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=sP0XiuTw9rqIhsEY1VYVnFJV0xlqBOUKeolPLYL5xQ4=; b=fqGQ8qWX7kUqjPtMm6+yFgitELXho5UlMt145mFA9FNBKNssNLLKvfXeljqaP7D5gm jJHxuLUVhykjos2l+KfXovASRV/DzilekTdjzRM/l88CBfZJ4LYZL3WZwwyl38iYqZ2Z HsFmvQOx7GE8FxMugFjo6gpLq5PCRLgQHqRo6xyw7h8Kla9q9XRaAAGWk27bffte7RNK ds/vmXmJaKQkBYxl30WeHQo9X7PGwGwJGoPubVoR5Aoy2EEzBUxn+JZdVriJiYwjrB2l UbsJX6QE8OSxMrreo2h44apsobl+Uc+s/CAlwP7FAR6lYpSDSM3AgOHHy3HFPeOOQ5ZA pqGw== 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 5si11392660pgg.505.2019.04.02.06.36.27; Tue, 02 Apr 2019 06:36:42 -0700 (PDT) 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 S1731199AbfDBNP3 (ORCPT + 99 others); Tue, 2 Apr 2019 09:15:29 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:6512 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731137AbfDBNP1 (ORCPT ); Tue, 2 Apr 2019 09:15:27 -0400 X-IronPort-AV: E=Sophos;i="5.60,300,1549926000"; d="scan'208";a="301531226" Received: from vaio-julia.rsr.lip6.fr ([132.227.76.33]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Apr 2019 15:15:23 +0200 Date: Tue, 2 Apr 2019 15:15:19 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Markus Elfring cc: Wen Yang , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, "Rafael J. Wysocki" , Viresh Kumar , Yi Wang Subject: Re: [PATCH 7/7] cpufreq: ppc_cbe: fix possible object reference leak In-Reply-To: <89ab8dd4-e997-1796-a522-863ff511bb58@web.de> Message-ID: References: <1554082674-2049-8-git-send-email-wen.yang99@zte.com.cn> <89ab8dd4-e997-1796-a522-863ff511bb58@web.de> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-1488356219-1554210919=:3297" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --8323329-1488356219-1554210919=:3297 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT On Tue, 2 Apr 2019, Markus Elfring wrote: > > @@ -86,6 +86,7 @@ static int cbe_cpufreq_cpu_init(struct cpufreq_policy *policy) > > if (!cbe_get_cpu_pmd_regs(policy->cpu) || > > !cbe_get_cpu_mic_tm_regs(policy->cpu)) { > > pr_info("invalid CBE regs pointers for cpufreq\n"); > > + of_node_put(cpu); > > return -EINVAL; > > } > > I have taken another look at the implementation of this function. > I find that the second statement “return -EINVAL” would need related > source code adjustments. > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/cpufreq/ppc_cbe_cpufreq.c?id=05d08e2995cbe6efdb993482ee0d38a77040861a#n96 > > How do you think about to complete the exception handling here? There is an of_node_put two lines above. julia --8323329-1488356219-1554210919=:3297--