Received: by 10.223.185.116 with SMTP id b49csp7240881wrg; Thu, 1 Mar 2018 02:11:02 -0800 (PST) X-Google-Smtp-Source: AG47ELu0Ky0cRm9zwYXRZn1jq7MywrZIHVykCJmBRyFJ0ZBW29qQcP8ELDADlOrx4bQy4WY5O/le X-Received: by 2002:a17:902:9a8a:: with SMTP id w10-v6mr1420838plp.201.1519899062230; Thu, 01 Mar 2018 02:11:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519899062; cv=none; d=google.com; s=arc-20160816; b=CDOx/FUBKp8km/BbJLIHR0cNswOYWWShGu4sk8HZvPmoIh2uytAIkaPDGelfM+Mo4v PpAPbkn/SNlepIwN3cZLbB4RAxxlVEM/G8Zpayu5XN43QYfhysdj/26i+8zU/i4fPzb4 wWJcCWhkgOWXCFX7Z4oBWl3lPYmoTlauFKzM4G8PwWVLibeWI6rCLAcxpkGo3uqJw2Ut YByv1ngTuqTkt0ykcWsAMqnw5FHNCRqRMgh6YHdAXDRtRFyk1uXpeOEIk94GtJAh+u1M BhykAuwaQh9wJVObKjc4ELarXJ9+U6qzp3dJW6TRRs0w5k2sKSGTEq1cRY9LhOyrs/hw RKjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=I+sJRylVb7QQznJ57FQ7z9uCyOYG4mbYeLNm+osiH/g=; b=rJMPXQuqXCQM7d3bUPFidGWjV7DtXVj0FFBi/VKRa3QKbO4CY94TEKjm59Qgewcke9 eYEyIwQAhyBkkv5p3J2rgdoOXGOHqjMUpHIWRRUDbWMGAkM0jKMWfH2w4xFzvoENXKJ7 AjTvs0qH4j6/kT3xEBQU0idYYfvvIpbjRL6/6V9MlgK1WJyN5CwWO0oTfxVz5StOLgbP 9UPCCX3oYKsGlrFzPQzoFEadQywN7NcvAniK1L6UO8Bww5s37tJ2lqxzY937Ruy3O43O Pt+QQkeJeQgfYo2KItVBWYP0IbdF9KMKU8UnZvPgkImmsf83wndocofD7twKxiVK/HJy yXpw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v10-v6si2883388plo.61.2018.03.01.02.10.47; Thu, 01 Mar 2018 02:11:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030225AbeCAKJK (ORCPT + 99 others); Thu, 1 Mar 2018 05:09:10 -0500 Received: from regular1.263xmail.com ([211.150.99.138]:39326 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967178AbeCAKJF (ORCPT ); Thu, 1 Mar 2018 05:09:05 -0500 Received: from jeffy.chen?rock-chips.com (unknown [192.168.167.76]) by regular1.263xmail.com (Postfix) with ESMTP id CC60479A7; Thu, 1 Mar 2018 18:08:59 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from localhost (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTPA id CD20A3CB; Thu, 1 Mar 2018 18:08:50 +0800 (CST) X-RL-SENDER: jeffy.chen@rock-chips.com X-FST-TO: linux-kernel@vger.kernel.org X-SENDER-IP: 103.29.142.67 X-LOGIN-NAME: jeffy.chen@rock-chips.com X-UNIQUE-TAG: <5848c984e68f54606d1e0b92b7f25ead> X-ATTACHMENT-NUM: 0 X-SENDER: cjf@rock-chips.com X-DNS-TYPE: 0 Received: from localhost (unknown [103.29.142.67]) by smtp.263.net (Postfix) whith ESMTP id 7344Q5B8TA; Thu, 01 Mar 2018 18:08:58 +0800 (CST) From: Jeffy Chen To: linux-kernel@vger.kernel.org Cc: jcliang@chromium.org, robin.murphy@arm.com, xxm@rock-chips.com, tfiga@chromium.org, Jeffy Chen , Heiko Stuebner , linux-rockchip@lists.infradead.org, iommu@lists.linux-foundation.org, Joerg Roedel , linux-arm-kernel@lists.infradead.org Subject: [PATCH v6 02/14] iommu/rockchip: Fix error handling in probe Date: Thu, 1 Mar 2018 18:08:12 +0800 Message-Id: <20180301100824.14887-3-jeffy.chen@rock-chips.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180301100824.14887-1-jeffy.chen@rock-chips.com> References: <20180301100824.14887-1-jeffy.chen@rock-chips.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add missing iommu_device_sysfs_remove in error path. Signed-off-by: Jeffy Chen Reviewed-by: Tomasz Figa --- Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None drivers/iommu/rockchip-iommu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index 16cd8780c289..c2ef3cbd4401 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c @@ -1193,8 +1193,12 @@ static int rk_iommu_probe(struct platform_device *pdev) iommu_device_set_ops(&iommu->iommu, &rk_iommu_ops); err = iommu_device_register(&iommu->iommu); + if (err) { + iommu_device_sysfs_remove(&iommu->iommu); + return err; + } - return err; + return 0; } static const struct of_device_id rk_iommu_dt_ids[] = { -- 2.11.0