Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp4055896imc; Sun, 24 Feb 2019 20:30:28 -0800 (PST) X-Google-Smtp-Source: AHgI3IbHw16Qz2qjcU3rqd+zL54gh/VcQ52X1Ln9Rf1vhkCCpsc6hdwgFeSxSs1ARjqkavi6pFzx X-Received: by 2002:a65:6491:: with SMTP id e17mr16960914pgv.418.1551069028052; Sun, 24 Feb 2019 20:30:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551069027; cv=none; d=google.com; s=arc-20160816; b=F8I0OGAE/EhP3Be36Zex72pP0RWowfRVFQqqB2MS5waTrpJHye/3tzPf00KB18SnYf pX9TCiVHq1/Ics+N7hP1ESss/XuSOBAOqzKURShAISJDl0RccVsH3AJAcHrrLdn5hiG8 QInjc6IMLULsw4TSY9NRlrRf+/xhdadUbvmwEIfAPqyGGXQzLvzMXtv0jC45l/znBMJg 9m+Sc4aVr4yh5xJ8uBZkFG1f09t6KsMXYX0ZKpor4rFbE7cwyPSh5ZQyjxz+Zr4KY1yC AjZBuHQ7jC2Ld1fwkx41BWgFJMAX1i1Jg3EaGCc3zIWfT4T+cd10yULGptzscPEQEJ8Q Mj1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=KWbWGTi5tHb6cmq9IznZT7SeUjiAOg830SMnYdOj7uc=; b=ObuZgNPCybMgD9Scfv7+EpIgzRrKB9kr8th1OadKxgoIcBnFSJqdVjEdpO5lkGRzD9 t7/Xac7sHNCvbYj3tJ5gkQppo2hbTNIGd2NOl7ajKPeC8GNuNqOp3lljWH0FFMWqf6l0 I4T4nw3PBjTeEZFr10u6EhKvtO0pePqKQ95GUBWpZPZKy7svOhcCh+oXKdDT1Rohjixd MRrkS8a9XQOvi2+qhwKtEQAI1LZtF9+8xZ9ZyRx3GHVQMV/yCm0CH0AIH1Ue3LqYtV35 Ijl6WzmTprwg4ynEmA9tUA0VEAVY4r8s4Skuog/M4bAfltJ4nBIbRfQdnpBxFqNSZol3 Qs2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bVFYCP50; 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 b9si12572pfj.255.2019.02.24.20.30.10; Sun, 24 Feb 2019 20:30:27 -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; dkim=pass header.i=@linaro.org header.s=google header.b=bVFYCP50; 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 S1727398AbfBYE3s (ORCPT + 99 others); Sun, 24 Feb 2019 23:29:48 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:41814 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726461AbfBYE3r (ORCPT ); Sun, 24 Feb 2019 23:29:47 -0500 Received: by mail-pl1-f196.google.com with SMTP id y5so3853716plk.8 for ; Sun, 24 Feb 2019 20:29:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=KWbWGTi5tHb6cmq9IznZT7SeUjiAOg830SMnYdOj7uc=; b=bVFYCP50PkWgrR9VqclOQcFW/NABe8gsTw4DDrIMC/2ypUVfc5MKvrjopu73q0wMzC Fx4CLHiZLXXGhZxqUQv2rsb8x/aPRcMMpqGijxtBbNav/qB+VaYFM5Po6TYBpQeF6v3Z 3AN7sRUU9LZKgUTafRTzgSrvJ5MvdEQQb0DcFqw+UHhyHzoKmD5YcrJMlEwtPdUnrzar /AtzVUzD/XK0chdW63yePg5zZLDSXfL1mussXNGFC8BIZyrrvo8060/LVbSbgF+mGHZj 1kLnokK1nIcZU9qFZgJZAqWUd+mZ5uQY9t4bsAg98nP3XkYB+UPq6fy6z4NGO4YVeN1L zUrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=KWbWGTi5tHb6cmq9IznZT7SeUjiAOg830SMnYdOj7uc=; b=qAdF0pVwIRt3BA3AgmfGMuoNnho2uIwMs3sjC3Zrtv7IBuul+D+LmmIiC29TOWY4dm ozgD+R9gIGFnBNRJlAw0X96RRZaQjyTv/9SR4iChnbn7on8aBnDkFNuUOvVLenN982P3 8iKUsnrr/QI94x68IzpXrf+8AWaZm2emE+voLkD2OzBEQtAMGyW7B97wEyK6dTL/oLq9 2WmXAu48QXrg1CRtLeAYn/M+8/A3pBWDT2rTt/Ygf6EEDBrIuVHX8YDur5rEGY6H0Zsw PA1kc84ud14SGqVK7zZJR1Bn4SakLQFJgJb6/8GcKpL6lP3S2yJKaA66f+4P9LEMoOcP fbuQ== X-Gm-Message-State: AHQUAuZjPsoBKmcu+ko/KjCox8JXMW1pj6tjAVlqoX9x7t/ZLnXAL176 gImgkGCdhbDcTaqXeSm/ahTNoA== X-Received: by 2002:a17:902:64:: with SMTP id 91mr18745132pla.229.1551068986348; Sun, 24 Feb 2019 20:29:46 -0800 (PST) Received: from localhost ([122.167.168.92]) by smtp.gmail.com with ESMTPSA id h79sm18526929pfj.186.2019.02.24.20.29.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 Feb 2019 20:29:44 -0800 (PST) Date: Mon, 25 Feb 2019 09:59:41 +0530 From: Viresh Kumar To: Julia Lawall Cc: Jason Cooper , kernel-janitors@vger.kernel.org, Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , "Rafael J. Wysocki" , linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 10/12] cpufreq: ap806: add missing of_node_put after of_device_is_available Message-ID: <20190225042941.wypmh4kikcgmebn3@vireshk-i7> References: <1550928043-14889-1-git-send-email-Julia.Lawall@lip6.fr> <1550928043-14889-11-git-send-email-Julia.Lawall@lip6.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1550928043-14889-11-git-send-email-Julia.Lawall@lip6.fr> User-Agent: NeoMutt/20180323-120-3dd1ac Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23-02-19, 14:20, Julia Lawall wrote: > Add an of_node_put when a tested device node is not available. > > The semantic patch that fixes this problem is as follows > (http://coccinelle.lip6.fr): > > // > @@ > identifier f; > local idexpression e; > expression x; > @@ > > e = f(...); > ... when != of_node_put(e) > when != x = e > when != e = x > when any > if (<+...of_device_is_available(e)...+>) { > ... when != of_node_put(e) > ( > return e; > | > + of_node_put(e); > return ...; > ) > } > // > > Fixes: f525a670533d9 ("cpufreq: ap806: add cpufreq driver for Armada 8K") > Signed-off-by: Julia Lawall > > --- > drivers/cpufreq/armada-8k-cpufreq.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff -u -p a/drivers/cpufreq/armada-8k-cpufreq.c b/drivers/cpufreq/armada-8k-cpufreq.c > --- a/drivers/cpufreq/armada-8k-cpufreq.c > +++ b/drivers/cpufreq/armada-8k-cpufreq.c > @@ -128,8 +128,10 @@ static int __init armada_8k_cpufreq_init > struct cpumask cpus; > > node = of_find_compatible_node(NULL, NULL, "marvell,ap806-cpu-clock"); > - if (!node || !of_device_is_available(node)) > + if (!node || !of_device_is_available(node)) { > + of_node_put(node); > return -ENODEV; > + } > > nb_cpus = num_possible_cpus(); > freq_tables = kcalloc(nb_cpus, sizeof(*freq_tables), GFP_KERNEL); Applied. Thanks. -- viresh