From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6F7CC433DF for ; Tue, 13 Oct 2020 14:14:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8ACEE247E7 for ; Tue, 13 Oct 2020 14:14:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388537AbgJMOOZ (ORCPT ); Tue, 13 Oct 2020 10:14:25 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:33820 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388488AbgJMOOX (ORCPT ); Tue, 13 Oct 2020 10:14:23 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id EE30A1C0B77; Tue, 13 Oct 2020 16:14:21 +0200 (CEST) Date: Tue, 13 Oct 2020 16:14:21 +0200 From: Pavel Machek To: Marek Szyprowski Cc: Pavel Machek , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Yu Kuai , Joerg Roedel , Sasha Levin Subject: Re: [PATCH 4.19 27/38] iommu/exynos: add missing put_device() call in exynos_iommu_of_xlate() Message-ID: <20201013141421.GA22886@duo.ucw.cz> References: <20201005142108.650363140@linuxfoundation.org> <20201005142109.977461657@linuxfoundation.org> <20201007094737.GA12593@duo.ucw.cz> <5b869c86-8d35-e834-4fec-6b63a942e484@samsung.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9jxsPFA5p3P2qPhR" Content-Disposition: inline In-Reply-To: <5b869c86-8d35-e834-4fec-6b63a942e484@samsung.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --9jxsPFA5p3P2qPhR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > >> From: Yu Kuai > >> > >> [ Upstream commit 1a26044954a6d1f4d375d5e62392446af663be7a ] > >> > >> if of_find_device_by_node() succeed, exynos_iommu_of_xlate() doesn't h= ave > >> a corresponding put_device(). Thus add put_device() to fix the excepti= on > >> handling for this function implementation. > > Okay, this looks reasonable, but... > > > > Do we miss put_device() in normal path, too? I'd expect another > > put_device at end of exynos_iommu_of_xlate() or perhaps in release > > path somewhere... >=20 > Frankly, there is no release path, so there is no need for put_device.=20 > Once initialized, Exynos IOMMU stays in the system forever. There is no= =20 > point to remove IOMMU nor the API for that. Keeping increased refcount=20 > for its device just matches this behavior. >=20 > If the missing put_device() is really a problem, then we can move it=20 > from the error path just after data =3D platform_get_drvdata(sysmmu)=20 > assignment. Feel free to send a patch if you think this is a more=20 > appropriate approach. exynos_iommu_detach_device() looks like a place where resources could be freed? But if there's no release path, we don't really need to do anythi= ng.=20 Sorry about the noise. Best regards, Pavel --=20 DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany --9jxsPFA5p3P2qPhR Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCX4W2PQAKCRAw5/Bqldv6 8m7vAJ4iXq02bm6+RavPQxrGMERfz/4fsQCfQdFAYbgb57aGCx7w0yA3EfNXz4Y= =CDgo -----END PGP SIGNATURE----- --9jxsPFA5p3P2qPhR--