From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C337F335BCD; Fri, 9 Jan 2026 12:44:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767962685; cv=none; b=e2UWsdKRy9KbeiJVKqOMKI26lb/8/TqVX1nMvl1KahsbJgMQH6Lj1gKB4Fz7Zfcy66mbMlaL3JqyVIx2kKXZO3sG6DBEXOqdZgjRl1IKJHiUNFAx0lPclUiK7XDt6EHAZJXAdeCDBDNWvX/4VFWQPPgZMK0oHPpibi3c8v1PAkk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767962685; c=relaxed/simple; bh=SJvA5s4Ecegoxrux4jq30sT7ZoVHRgtVDdt5VerhZuc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W//BzHVmelvepQ+QST2m1OuUuALIeP7nLWR5FoLYdml8HRgawg6JXCbB34QSHutit8B4NX2SEpFP4NuR+dp7KrYkMWUWsIvpWVe9Iese6KfdQs6Vp/kdwwWNzuaGJVKUyMOBIYfXNEOTmd5icE24M8XixBJJ4gNBDicLXRKsv9E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=FdCcRjaK; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="FdCcRjaK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4DBE9C4CEF1; Fri, 9 Jan 2026 12:44:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1767962685; bh=SJvA5s4Ecegoxrux4jq30sT7ZoVHRgtVDdt5VerhZuc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FdCcRjaKYtWjFotCjOD4hfc7fMo1h7at48b1hyXEHe1uOWrdOgWxEU0XjIcweiEXv 7vOXS09x6fjpnMW7VC/samds4FLJ9Kv95JzbIzD/QDCYn68xiGXwrKVv5c/9pcZxF1 fMF9fw+9abYdRtgVNudwa54e3q3KiC/uIIiDngA0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yu Kuai , Robin Murphy , Marek Szyprowski , Johan Hovold , Joerg Roedel Subject: [PATCH 6.1 451/634] iommu/exynos: fix device leak on of_xlate() Date: Fri, 9 Jan 2026 12:42:09 +0100 Message-ID: <20260109112134.511900611@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260109112117.407257400@linuxfoundation.org> References: <20260109112117.407257400@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johan Hovold commit 05913cc43cb122f9afecdbe775115c058b906e1b upstream. Make sure to drop the reference taken to the iommu platform device when looking up its driver data during of_xlate(). Note that commit 1a26044954a6 ("iommu/exynos: add missing put_device() call in exynos_iommu_of_xlate()") fixed the leak in a couple of error paths, but the reference is still leaking on success. Fixes: aa759fd376fb ("iommu/exynos: Add callback for initializing devices from device tree") Cc: stable@vger.kernel.org # 4.2: 1a26044954a6 Cc: Yu Kuai Acked-by: Robin Murphy Acked-by: Marek Szyprowski Signed-off-by: Johan Hovold Signed-off-by: Joerg Roedel Signed-off-by: Greg Kroah-Hartman --- drivers/iommu/exynos-iommu.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -1370,17 +1370,14 @@ static int exynos_iommu_of_xlate(struct return -ENODEV; data = platform_get_drvdata(sysmmu); - if (!data) { - put_device(&sysmmu->dev); + put_device(&sysmmu->dev); + if (!data) return -ENODEV; - } if (!owner) { owner = kzalloc(sizeof(*owner), GFP_KERNEL); - if (!owner) { - put_device(&sysmmu->dev); + if (!owner) return -ENOMEM; - } INIT_LIST_HEAD(&owner->controllers); mutex_init(&owner->rpm_lock);