Received: by 10.223.176.46 with SMTP id f43csp568236wra; Wed, 24 Jan 2018 02:36:46 -0800 (PST) X-Google-Smtp-Source: AH8x225Ug6NWmmTxQK3bIBR7OYTreEdjZ2LxYenx8i5eIrEwqVGkXMr1FPZgnyouBHXamOkVVETu X-Received: by 10.99.164.25 with SMTP id c25mr10474250pgf.430.1516790206137; Wed, 24 Jan 2018 02:36:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516790206; cv=none; d=google.com; s=arc-20160816; b=SYh4mN/wNfUguSvE2fGQG3EdmjM10RtsVAn+FXbTd922JWleZlRVFELHgbsC236QI8 Mags53LIEBwTxDL9VxPpIoZzbfLm0D96ZXEwGjAgShzW4O0L19CCt5kgr7QqPVvbgCFU Kr5HeqMEg+aXDkTb2PlKOSbXwN/crb0EkQcM/7lsS9vESeCo7SRax9Dj8upLHJiypU43 Dp62yrie6X3eWBWfMhM7nOM+wtIleMBcKYAa/eMSx0XKtG46W1X+CZurxiYLsQ7aXFb1 uYk2okzD/mZQMSkzZ2KqPt+jDxeq6QI577B5vO0W60voHfdNyE04npPxIEQ5E3lz/tAS n4Xg== 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=wKp2ZWkMru77Eex6PHARq55tLlejAZdQunintvKXJEc=; b=pKq/tEj0rAbNnhQvo6P7zjc+dZNvMvdvFDLb2uTti/hNDSswPZU/pH+T7vQ6A1hmPM XwbUkfByN1VeH7vLSVxrTieSLqz7hHCjM2iqZPci591PoY9sx5b7WbXKFTcu4KySgXB0 2A07j9TBm0peI5WDZOXb1NKCC0yL08apnr/ywRu1rs4y74AbMvilxABkuiKMbLNwvxj/ ZBlU2vGGo2BF8alaXh45nYJjJxJ7z7zAq/2/yhpR6tk5rhtA/aLzOVroraGNgVICeTz6 klg2qUabYqMGqe5K0vKhH13E+3QAkUrn8PXzJosy3U36rBAeoj0UuFuFQFxU90AQDllv Qdhg== 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 z21si15465329pgu.773.2018.01.24.02.36.32; Wed, 24 Jan 2018 02:36:46 -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 S933108AbeAXKft (ORCPT + 99 others); Wed, 24 Jan 2018 05:35:49 -0500 Received: from regular1.263xmail.com ([211.150.99.141]:57544 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932884AbeAXKfr (ORCPT ); Wed, 24 Jan 2018 05:35:47 -0500 Received: from jeffy.chen?rock-chips.com (unknown [192.168.167.243]) by regular1.263xmail.com (Postfix) with ESMTP id 3F30A79; Wed, 24 Jan 2018 18:35:44 +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 4BA39399; Wed, 24 Jan 2018 18:35:38 +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: <7693125a63ed7f0eee546c962821150e> 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 4892XSFFSV; Wed, 24 Jan 2018 18:35:44 +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 v5 02/13] iommu/rockchip: Fix error handling in probe Date: Wed, 24 Jan 2018 18:35:05 +0800 Message-Id: <20180124103516.2571-3-jeffy.chen@rock-chips.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180124103516.2571-1-jeffy.chen@rock-chips.com> References: <20180124103516.2571-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 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