From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756493AbeAROXI (ORCPT ); Thu, 18 Jan 2018 09:23:08 -0500 Received: from regular1.263xmail.com ([211.150.99.134]:42297 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756215AbeAROXH (ORCPT ); Thu, 18 Jan 2018 09:23:07 -0500 X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-RL-SENDER: jeffy.chen@rock-chips.com X-FST-TO: robin.murphy@arm.com X-SENDER-IP: 103.29.142.67 X-LOGIN-NAME: jeffy.chen@rock-chips.com X-UNIQUE-TAG: <4a6aa7cfc8aa6065f0b9d99b226728a8> X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Message-ID: <5A60ADBD.4050303@rock-chips.com> Date: Thu, 18 Jan 2018 22:22:53 +0800 From: JeffyChen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20130126 Thunderbird/19.0 MIME-Version: 1.0 To: Robin Murphy , linux-kernel@vger.kernel.org CC: jcliang@chromium.org, xxm@rock-chips.com, tfiga@chromium.org, Heiko Stuebner , linux-rockchip@lists.infradead.org, iommu@lists.linux-foundation.org, Joerg Roedel , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v4 04/13] iommu/rockchip: Fix error handling in attach References: <20180118115251.5542-1-jeffy.chen@rock-chips.com> <20180118115251.5542-5-jeffy.chen@rock-chips.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Robin, On 01/18/2018 09:23 PM, Robin Murphy wrote: >> >> @@ -837,7 +837,7 @@ static int rk_iommu_attach_device(struct >> iommu_domain *domain, >> ret = rk_iommu_enable_paging(iommu); >> if (ret) >> - return ret; >> + goto err_disable_stall; >> spin_lock_irqsave(&rk_domain->iommus_lock, flags); >> list_add_tail(&iommu->node, &rk_domain->iommus); >> @@ -848,6 +848,11 @@ static int rk_iommu_attach_device(struct >> iommu_domain *domain, >> rk_iommu_disable_stall(iommu); >> return 0; > > Nit: if you like, it looks reasonable to name the label > "out_disable_stall" and remove these lines above here, to save the > duplication between the error and success paths (since ret will already > be 0 on the latter). > right, i think so, will do it in the next version. > Either way, > > Reviewed-by: Robin Murphy