Received: by 10.223.148.5 with SMTP id 5csp7311131wrq; Thu, 18 Jan 2018 04:01:27 -0800 (PST) X-Google-Smtp-Source: ACJfBou8X9IK2kQuckiGpQgyrC9FSrkXd4xDGxxFTlfwwVAdwcH6WCbXhBpHmtxT+V/2cwlVox2z X-Received: by 10.99.113.75 with SMTP id b11mr27299474pgn.271.1516276886948; Thu, 18 Jan 2018 04:01:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516276886; cv=none; d=google.com; s=arc-20160816; b=ILKHkq+jTNxd9BwuizcO3W1teSETKTwA8YQS+lcLF0f9J1GhRXfyrUcKCNtfQFh4sa iTHil2+y6j0uJjfwXxgllZo3sCow+dO1MlTYdWd1DCT3kMLDRyrW4s8dtQ7sdQc781Hq ltZ2e7J1wuDvCtzu2rjO+3P97dix7+TZ+42M6Dv96NfxCgQco5Z6ZQmSaJ9DaUFqUoOL AyTjK+QMKWw1xx2Kwedd/Hrh9uubFgEOuUd4y4hm/WchROA8+PjXA2E0LPFDv29muR79 OmLHOM7GCROl0I8bXl1FFAydoEd0XDsKvlU9oUJSaCdZzBd+Jm9am37AOCYAXtHmD4ur gxtQ== 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=NXsVmPCelg3b75LCMjzsU2tm5oYS6Z+BdnTInenP1SA=; b=ky9cuaIRuOKqBt3eSNpME2ULgJDCEwaa8/NAE0VFKA4iEujSLjmDynu59dyq6+vfB8 A2uJ43Q3Pr5lZe4l2sJp1Rifcpyva8EBfbtZuy3l0R8Evn63uANAUqkznkLUVX1DDs61 Q0EZNOKQDSTJR7D8GUDuvcg5T7kUFwwklugyCkgE+/E6Tsl/rElJfkCb6ggYKB8zFtp0 r5Zr5B3v/h032kaJBlgMPz4dhl2sc9AET7mfXxw7k5p+kBjuPlfUewY3fq92LlKsC6se jBq6EqjOJVUU/VFqeWcWMlP4euXWCbLXW34xi2XrJQt51xWZbAkyojlFk6lA+qJ2Elj5 FN5g== 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 a14si3757135pgu.361.2018.01.18.04.01.13; Thu, 18 Jan 2018 04:01:26 -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 S1755572AbeARL4h (ORCPT + 99 others); Thu, 18 Jan 2018 06:56:37 -0500 Received: from regular1.263xmail.com ([211.150.99.141]:57311 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754931AbeARLxS (ORCPT ); Thu, 18 Jan 2018 06:53:18 -0500 Received: from jeffy.chen?rock-chips.com (unknown [192.168.167.154]) by regular1.263xmail.com (Postfix) with ESMTP id 5684688; Thu, 18 Jan 2018 19:53:14 +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 81E96389; Thu, 18 Jan 2018 19:53:07 +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: <92020dbe854a0822c340dc457eeaa41b> 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 9385ZBDWQQ; Thu, 18 Jan 2018 19:53:13 +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 v4 02/13] iommu/rockchip: Fix error handling in probe Date: Thu, 18 Jan 2018 19:52:40 +0800 Message-Id: <20180118115251.5542-3-jeffy.chen@rock-chips.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180118115251.5542-1-jeffy.chen@rock-chips.com> References: <20180118115251.5542-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 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