Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp558198img; Thu, 28 Feb 2019 04:16:08 -0800 (PST) X-Google-Smtp-Source: AHgI3IY27VKDs5RWNrBqKNJv6LdEfzBWKrjqBX6YGI6czzLNjVlcrkrbMUMEdoCjQBSnM5UgdLwK X-Received: by 2002:a17:902:581:: with SMTP id f1mr7773069plf.210.1551356167728; Thu, 28 Feb 2019 04:16:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551356167; cv=none; d=google.com; s=arc-20160816; b=KuZpWcqs3IilMN1lPoJpUWui54NkdXN5162LIC60YgI98w+vv/ReTePptsGDFWCuCE 9eXMGYvZwDhrnyvruFzYHRhruURV/4B0rvMT1kkm4q9OSGyw5oqpQDfsQOl2atFAbIdU 5sit3Z7jRvaCJiu7JFMdruN0Ct6w7/SCsPsCM40eF5z4g5Hib9I4lY8bALflRIMkONHc LE4xy4LaBZgmXDYs5V+7UwAliUp1ZaMRNPk672oxg5C2v2RwwWy290WmYWD5AsuVsBdw qBqrarl4fSQn7q3yPlEwXvIS9NiQYWD7OhMCs1vGtryw1nX5zAfBoW6FAQ8e+v2q7DrT y0uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=JEqCH0xeq/DKANfJYARB3choSwMbkMxuXgceEII+fxc=; b=dbnr7jL5JLoiuYcmtHdCG2g+5uGsKqTT2+ylF968HfmYcV8s8Vsr4MXr47EqvdenYZ /gZiqHajBmdIT2ObK2WRNSEXFadh00C2QNVGeGfoI2WsvOjgu4INzVmrxqZXDnk32O06 D0ch0snTlr/3+K561E69lVwvQ6RLEUKhaSKa/sLgr7PNFat/gECF/hG+/TJPleuwlOyV SnvwBXB2q+gOUsd2fOIUMQNBeaY7rS8S2rnPOYkXYnd2+IUGp0r7vdhU2WT0rKgh74eq sn9AvZ+oDoG69wAFrUxdkWzTN2EVdCK+uw8I1bUg+RR44dix6i2JSNx2CZ+Oekn3aKBr qcYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lvkQZQJM; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f89si15038147plb.20.2019.02.28.04.15.50; Thu, 28 Feb 2019 04:16:07 -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=lvkQZQJM; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731912AbfB1LRN (ORCPT + 99 others); Thu, 28 Feb 2019 06:17:13 -0500 Received: from mail-it1-f195.google.com ([209.85.166.195]:36067 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727857AbfB1LRN (ORCPT ); Thu, 28 Feb 2019 06:17:13 -0500 Received: by mail-it1-f195.google.com with SMTP id v83so15065231itf.1 for ; Thu, 28 Feb 2019 03:17:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JEqCH0xeq/DKANfJYARB3choSwMbkMxuXgceEII+fxc=; b=lvkQZQJM3bIepgY8ryxe6yBsM0QLCZUK+oYoObsdY7Xp/3OotdEzIHhifzZRJLEVV7 GvjbF7gc7fmj5y3V1mXf9+TRUINIR/80Tr+sFnyDcYj5uch9GEKJqsBMsYNz1sUnnvWG bKwY2VtMagWcrWpXQlLdEeKNxresxU6irhvd940AGu+XvWKSqFA981PrIXMADMylLzfU yP9vsa3sxLe8oy7m7JCC3yEo2ZBSwEWa1XHlNe/1slwU1poeiJ0hvfJk+aUzUZPwuFAX oDH5h9Il0JA3xZBuEac5FkddbEPo/Vp7+bv2caj1R4dZfXdrii8uettZjnu4wyOG4AoX 3rSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JEqCH0xeq/DKANfJYARB3choSwMbkMxuXgceEII+fxc=; b=KW+5pRHoQw9l83hx0luC/HOa6l+c+c8/04Njm9l4KGydBCPm8k2ISQYw9hHk04Xl20 FiIaf07mQp0CAUsVZVEFWd8azsX5OIuqr2SFJhkzz8MeQAEbbF7pTYguGkAq0xCZv4I7 voSNfQX7uJKWIZmV1vFDm/R4gcrEN8eZrj9V8wqPGHbCf7hVKxzDnHLtHa9PUB9A/dU3 UWBxVWhvPTzZClxVEyVO1GeUPIEnlC+vgiawWp5jWZH5Q8zqBZ0KwQ637p5rurW8e2sI pBgAaOOeicsay5k88Nd8nolenO7E6mXRdErQxCf3dV05A7rBoBwphhccIsv7/ms8tvBj 2+3g== X-Gm-Message-State: APjAAAW4Ls7SD3yPpawhx8yvFSLEqGOV7q/fGwLfz3yclEOB7MdlTAKr xP3Q28Y5wZluK6OJdtJTXYr8Pole4n5X54u0mIiFEA== X-Received: by 2002:a24:9686:: with SMTP id z128mr2501961itd.97.1551352632347; Thu, 28 Feb 2019 03:17:12 -0800 (PST) MIME-Version: 1.0 References: <1550928043-14889-1-git-send-email-Julia.Lawall@lip6.fr> <1550928043-14889-6-git-send-email-Julia.Lawall@lip6.fr> In-Reply-To: <1550928043-14889-6-git-send-email-Julia.Lawall@lip6.fr> From: Jens Wiklander Date: Thu, 28 Feb 2019 12:17:01 +0100 Message-ID: Subject: Re: [PATCH 05/12] tee: optee: add missing of_node_put after of_device_is_available To: Julia Lawall Cc: kernel-janitors@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Julia, On Sat, Feb 23, 2019 at 2:58 PM 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: db878f76b9ff ("tee: optee: take DT status property into account") > Signed-off-by: Julia Lawall > > --- > drivers/tee/optee/core.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff -u -p a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c > --- a/drivers/tee/optee/core.c > +++ b/drivers/tee/optee/core.c > @@ -703,8 +703,10 @@ static int __init optee_driver_init(void > return -ENODEV; > > np = of_find_matching_node(fw_np, optee_match); > - if (!np || !of_device_is_available(np)) > + if (!np || !of_device_is_available(np)) { > + of_node_put(np); > return -ENODEV; > + } > > optee = optee_probe(np); > of_node_put(np); > Applied. Thanks, Jens