Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp829670pxk; Thu, 17 Sep 2020 18:13:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyVSZD0KbRTsomOlNAqucdLLSFabzLO8C4KtspXAZvblUU+NtB22DiYPP+7y72h0ntwRf6 X-Received: by 2002:a17:906:a00d:: with SMTP id p13mr34558991ejy.535.1600391633677; Thu, 17 Sep 2020 18:13:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600391633; cv=none; d=google.com; s=arc-20160816; b=VqfZJjXWYbXsTqI46wN7VNE2wAH4diqG8okqIl9pkvaN5JLA+kzs0zOrhbLEqZZZzC kbzJO2Fp8VCU+pEasBkgqqaPm/q4QQsSSPUTtT5zb+/q9UKeo+5Ihw9SAkIRxf/WeYqk xrJU15vAI/lcDf5d57MyKqSWPO2/6fF1c1GMhHt1mjYI1o5FSUPrXix5MHTlxEMjntKe snPwX+f6SRe7Uf3g5m0NzIOD+Gf9fPr9D0agW6K7MYGzLU2OPsIwyWYFQdO4PTy4ZTwG Ys0y7QvC780wrnoEmZUPhgHgH4lBTrR/TIQvBjyrobUFnjxGw06cOssm90zfEI5k8BYi +Kuw== 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 :message-id:date:subject:cc:to:from; bh=It+A/7IXDL0u5Q6Zgu6UMsfy1kLUDJg9cFYw6P3ycSc=; b=bEkGZgF4WGqwfJFDFCR0Zeb9rj6wuvPEeW6UG+UHUEVAzhp4Uv9ebQrMPsoQcehb6K PWPw0hdZMkw2HVarQPWqrWnPsKOmcDGtJCnEr/oDHDVuy9bCoHVg/HJu5sG2lZEgLqop TBNSNH11KP26jw0geqqGPHrIaIgdZMg2ZSWkgLbGWC2wJYVXsRFWKagovqspGD7aP7xa ODUpWI4hmaUIYKcWYX+u4l3W+Sg0/nCOkPQrJ6fApGa+hYKPPw3F4smwE4s1XgYbdkip V7AhT3IfovBPnLbfWtL2cYwxlQcHWsdimxTNotj8DiiIJhrPyQVNQvo79fplEGchvbW4 Qm3Q== ARC-Authentication-Results: i=1; mx.google.com; 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 la9si1051741ejb.699.2020.09.17.18.13.30; Thu, 17 Sep 2020 18:13:53 -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; 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 S1726102AbgIRBMh (ORCPT + 99 others); Thu, 17 Sep 2020 21:12:37 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:13244 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725987AbgIRBMh (ORCPT ); Thu, 17 Sep 2020 21:12:37 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id CA5C5D147F08C0996032; Fri, 18 Sep 2020 09:12:34 +0800 (CST) Received: from huawei.com (10.175.127.227) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.487.0; Fri, 18 Sep 2020 09:12:24 +0800 From: Yu Kuai To: , , , CC: , , , , , Subject: [PATCH] iommu/exynos: add missing put_device() call in exynos_iommu_of_xlate() Date: Fri, 18 Sep 2020 09:13:35 +0800 Message-ID: <20200918011335.909141-1-yukuai3@huawei.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.127.227] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 bad3c0ce10cb..de324b4eedfe 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -1295,13 +1295,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); mutex_init(&owner->rpm_lock); -- 2.25.4