Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4005627pxu; Mon, 12 Oct 2020 07:10:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxC/d8wSadh80C86NSxDrhvv+UyU05BHiI0Iju9I5ufwTe6Kbu5z+jpyjMWTDmM4YOlPtOY X-Received: by 2002:aa7:d781:: with SMTP id s1mr14770449edq.102.1602511832501; Mon, 12 Oct 2020 07:10:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602511832; cv=none; d=google.com; s=arc-20160816; b=qn8dYmoGXudkaVvpHdYymoyuO5qJ3pYKXvatltZHiT8YqSUjvW6D2NwhpPAIvh8BSG +joHp91c83SyUopFQ52//TUCQS28nhYBW9BcktB7B9yXb5lYmLniQJz83FJ0UoV3JK3t RubA+OMWHxu25RWkZoMdTzoZ/pgCC5SRfuzvOXu2CsKaZJIaRv+HzlNE/xzXY+OJLZQ9 +Dz34bSLouDO1dqc3LoV9k/SPJjKXHsL5PaSLixH/+xwWIw3DfO/GGJKzSsIwtSj6vQN aiBPaVJF4HOBIpvxa3FG7491gzbcmujDeQNz8WT6P0MdyNAkVQaFKH3WFS1DYnuoA4mA 2ugw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=oapf1s2p0xKZO7DH/LKipxl0ilpzWTg33VkOj+AtH+c=; b=Bm67zVJ3lOtq8VlFMVSfVmzydJ8Nd38We2O57TQzCpFajPPfXWFRJzGrktYBTJEzHv uKNWoxG3eVFPTfwgTCbz3IVLXGKzKNimwZ/wx9YgWjKUbG4Zhe7tXnPoYbm5pkOdcMjB FJg8hE1M2HawsUimUr9mxWntBVuSJB9fDyD2KVRrde6Wzu0KorZlFDyQGvKa0e1KVYDX 8l+b6qKlrj6ybqmTEuU/B4ZbuoZ4DsHaPK5LOz9JmAK5gQv+AaKj7u6McPZlpihj8Wac 9mEELIbaFyvoZS9QwvuKyWNeSZhQeu1VsDayL0v7UkBXBTFWNUg6nDwm/Pu/hsIVNN8V L7Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oS4qntBh; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g19si7254961ejd.105.2020.10.12.07.10.09; Mon, 12 Oct 2020 07:10:32 -0700 (PDT) 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 header.i=@kernel.org header.s=default header.b=oS4qntBh; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730344AbgJLOIN (ORCPT + 99 others); Mon, 12 Oct 2020 10:08:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:36740 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389225AbgJLNeV (ORCPT ); Mon, 12 Oct 2020 09:34:21 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 19526215A4; Mon, 12 Oct 2020 13:33:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602509621; bh=Sk17WUeJFmvZw7vGnTJ9gGzFZbhHP9bVX7SaI9iXvtQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oS4qntBhQ1NtJpuCqQlNmEhjcLba1R7/n74qAffhN028DuY216nu0+osgQ6kFYLlJ 7YtZDzX2N03Rd+l17kI+YOG8Q3ALtT4SsY/5mLwFCm2b9bymuV9Lh9SDKYRVx/Dyxi qwOQeqeI9QBP4PBgogdVN2jZUDFYkZTL03WG/G7o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yu Kuai , Marek Szyprowski , Joerg Roedel , Sasha Levin Subject: [PATCH 4.9 14/54] iommu/exynos: add missing put_device() call in exynos_iommu_of_xlate() Date: Mon, 12 Oct 2020 15:26:36 +0200 Message-Id: <20201012132630.252717421@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201012132629.585664421@linuxfoundation.org> References: <20201012132629.585664421@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yu Kuai [ Upstream commit 1a26044954a6d1f4d375d5e62392446af663be7a ] if of_find_device_by_node() succeed, exynos_iommu_of_xlate() doesn't have a corresponding put_device(). Thus add put_device() to fix the exception handling for this function implementation. Fixes: aa759fd376fb ("iommu/exynos: Add callback for initializing devices from device tree") Signed-off-by: Yu Kuai Acked-by: Marek Szyprowski Link: https://lore.kernel.org/r/20200918011335.909141-1-yukuai3@huawei.com Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin --- drivers/iommu/exynos-iommu.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index beef59eb94fa7..626b434e7967a 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -1265,13 +1265,17 @@ static int exynos_iommu_of_xlate(struct device *dev, return -ENODEV; data = platform_get_drvdata(sysmmu); - if (!data) + if (!data) { + put_device(&sysmmu->dev); return -ENODEV; + } if (!owner) { owner = kzalloc(sizeof(*owner), GFP_KERNEL); - if (!owner) + if (!owner) { + put_device(&sysmmu->dev); return -ENOMEM; + } INIT_LIST_HEAD(&owner->controllers); dev->archdata.iommu = owner; -- 2.25.1