Received: by 10.223.185.116 with SMTP id b49csp7248766wrg; Thu, 1 Mar 2018 02:20:55 -0800 (PST) X-Google-Smtp-Source: AG47ELvIXHa8glWhiZrDzbe+gfgPSb4/sZY+dbbCinIdZpg6KR3eyoACqm9BmyGJ1BRp7ab0vnMr X-Received: by 10.98.206.1 with SMTP id y1mr1423393pfg.196.1519899655636; Thu, 01 Mar 2018 02:20:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519899655; cv=none; d=google.com; s=arc-20160816; b=fcytOONehPvq0OCBlPTjHy8kzAHrTWlkBWh0ARjWdPO1kGuchpyy3Oyf8hxd/etP+G 3A2muO8EK24YSaH6FowitC5nf5yZud9N7rHyQoTMsVc0vwfXkLcrHGnS9F783qPAKUbF 31nuXCusfMSWYxfhZic1nIjbHIIsyR0Vfp1Mz053sMYqayAeMl0qdEm17pDrHpaDXykP aGhfmKwTE+A20/psPK+leJ20KC1+T8uvT1glyKWEtI2p+hiH/oRB9MeL+1/HKZVu2S6w AoNfUoJoQNSoqvld4d3FyN2IqvOOq0R8rbynx7QtNuEPsNdgk1JjRzEc/BOUp7ZcSHVz HgaA== 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=cXBIeGDqJ0bFrR3OnysQbc3cxydQBKU0B7BlI6NUSQAJcQV67kew5lV3HMB7FgixR7 IWWRnBbeLvLAXVt94T8OfgCjbwG/SvPkAVp7uMPUm8qlgE4kQzhcDTFGPa0O8TC0xVmw FTPpXimE+/sziM80qkrcn0jpEsnhTK7mPEwO1KTIiZ+6OJDBERMcB+JCPG7GsBG0x9EO gl3Pc7hRA+jchzHeUluEJI6dgLhrgU/e6Ry53bq4QhjcMN51K2Aw5GPO6BULVuaFToeA agmiAFyy6Vi2qImHXg2gqAmsNzCiwyL74g7xwtjcM6Kvb0h6QbOVq7npIIh+sALScpnm vMyg== 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 f10-v6si2827002pln.821.2018.03.01.02.20.41; Thu, 01 Mar 2018 02:20:55 -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 S966014AbeCAKT0 (ORCPT + 99 others); Thu, 1 Mar 2018 05:19:26 -0500 Received: from regular1.263xmail.com ([211.150.99.135]:40345 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935715AbeCAKTS (ORCPT ); Thu, 1 Mar 2018 05:19:18 -0500 Received: from jeffy.chen?rock-chips.com (unknown [192.168.167.233]) by regular1.263xmail.com (Postfix) with ESMTP id 9752E1E020; Thu, 1 Mar 2018 18:19: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 7C800381; Thu, 1 Mar 2018 18:19:09 +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: <77124801db895ccad17d22c12facdead> 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 2884GQMDRL; Thu, 01 Mar 2018 18:19:14 +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: [RESEND PATCH v6 02/14] iommu/rockchip: Fix error handling in probe Date: Thu, 1 Mar 2018 18:18:25 +0800 Message-Id: <20180301101837.27969-3-jeffy.chen@rock-chips.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180301101837.27969-1-jeffy.chen@rock-chips.com> References: <20180301101837.27969-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