Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9046566pxu; Mon, 28 Dec 2020 05:20:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJxhBx+Wk0TOvqs/mhWmT6+ih2VTJ/xGzC1Lb7UzWeItBcikYfktZSekYRMD9q+Uq1hMNeaj X-Received: by 2002:a17:906:c09:: with SMTP id s9mr41576475ejf.539.1609161600598; Mon, 28 Dec 2020 05:20:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609161600; cv=none; d=google.com; s=arc-20160816; b=Ft/dAC0b0qe/5YYMpBcabK4dGowyBmDuWdgZp4KLgz6aVvzKF5KW57N/mukd+jbimF reDyHTQAfZ6/rsPnNHIo8MPaJLKpWUDGpmlVZeN01bG/HMLeCqscZC2dF5QtRJxnygPk EptLKD1KN8EPgIyM/u5flR0jHLc5qNezxyrPboPxpSYFZcbeVBNRpgj5KtarbkFwR+tt EnD5BiKlXhEiDkc9x9S7Ho2rJimfKgCQM45NyvMpwpiGiAiAtGOHkn8PeVmT6vqKaCap FhoAtk/PfgZF8JJEB6xd2J46tnz7igwc194hUzy6rwB+NbWikgmOz/riwzDMW2qGobJI Igaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=HNy9H60j8AbyE+yPjVSBSrWm+st4c4fCvuk6qPKm+18=; b=vaikJE6LfhmoKnG9niXeV2LSQBYXvDlRUYvWrzaa1KaFxwx26TWcPmnCbpSY4tyMiq pvfbxNOlSA/xOz5kzWwsjBm5xdGCaPLnSfSdf0wHMZVTH5b9QdhxpZALcEa4dQgeeTaj C6Ubn70KJXjg4B51xaAeaXAUfQhbELCinaQ6zFKQoblOZI2/savHUg55AuYeZz8Pkk8W mB88iYpeR1WIbBLN6g6UpIkF53eXhjg0WfEeJG5JDnBkxD3qsJVZN/5chrQ2tkhGz1D7 XvC2txLcTxD8B0Kt5SZ/BG8JEnBH0dC+bbJcEXt2byCSSdkEkq8VUMswtvgjiNiQQT3Z YQgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=sfs1EOUq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu15si18174668ejb.667.2020.12.28.05.19.37; Mon, 28 Dec 2020 05:20:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=sfs1EOUq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731660AbgL1NSA (ORCPT + 99 others); Mon, 28 Dec 2020 08:18:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731631AbgL1NRw (ORCPT ); Mon, 28 Dec 2020 08:17:52 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 207B8C061794; Mon, 28 Dec 2020 05:17:11 -0800 (PST) Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6598799; Mon, 28 Dec 2020 14:17:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1609161428; bh=IcgI8ZiGoVQeWrVhvAi4jCXSswEN/GJ7vur314v3VMs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sfs1EOUqkruSzYbSEdcuk/cDF6oMCJCLnv0bV8O88ff8F8X8nw0hVOMbHqSf2qLpH aPxcY5TLOt7EfBroZAfYiZ2vcIH5nLWFirVjKEQjFHB9GzweXPdQ/YLUaqVV7iBQXJ UAXcWMX5N32ipvAc2PuLZwxez4jm1c+I/7MRSeW8= Date: Mon, 28 Dec 2020 15:16:58 +0200 From: Laurent Pinchart To: Ezequiel Garcia Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@collabora.com, Hans Verkuil , Laurent Pinchart Subject: Re: [PATCH] media: v4l2-async: Put fwnode after last access Message-ID: References: <20201228121725.133898-1-ezequiel@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20201228121725.133898-1-ezequiel@collabora.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ezequiel, Thank you for the patch. On Mon, Dec 28, 2020 at 09:17:25AM -0300, Ezequiel Garcia wrote: > fwnode_handle_put() should be called after the fwnode > is last accessed. Fix it. > > Fixes: b98158d837ef ("media: v4l2-async: Accept endpoints and devices for fwnode matching") > Signed-off-by: Ezequiel Garcia > --- > drivers/media/v4l2-core/v4l2-async.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c > index e3ab003a6c85..1303c9b83138 100644 > --- a/drivers/media/v4l2-core/v4l2-async.c > +++ b/drivers/media/v4l2-core/v4l2-async.c > @@ -78,6 +78,7 @@ static bool match_fwnode(struct v4l2_async_notifier *notifier, > bool asd_fwnode_is_ep; > bool sd_fwnode_is_ep; > struct device *dev; > + bool match; > > /* > * Both the subdev and the async subdev can provide either an endpoint > @@ -113,9 +114,10 @@ static bool match_fwnode(struct v4l2_async_notifier *notifier, > other_fwnode = sd->fwnode; > } > > - fwnode_handle_put(dev_fwnode); > + match = (dev_fwnode == other_fwnode); > > - if (dev_fwnode != other_fwnode) This only performs a pointer comparison, it doesn't access dev_fwnode. I don't think the change is necessary. > + fwnode_handle_put(dev_fwnode); > + if (!match) > return false; > > /* -- Regards, Laurent Pinchart