Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp987645ybk; Wed, 13 May 2020 19:34:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwSi0LH0C/p8/G5C4sBsoP67SBonOF2gg+V1Ua3HNmNo/b7WFJe090JESSMBx6iO/7jqgj X-Received: by 2002:a17:906:4e46:: with SMTP id g6mr1836566ejw.36.1589423678768; Wed, 13 May 2020 19:34:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589423678; cv=none; d=google.com; s=arc-20160816; b=jcN04VApHDtuYpGuPBpX4WOKZ93dggdJohP4RTA0YZkS47tAl7GJPRpYVgnepSGSlv QHt8FzLkP6clPDX3H/QOGunEffvA+02esG1/kCKNKuk1b1Kw9+6Ikf+j0XfeJGDcvBtk jmDhu7u8sPD9+M8HbohSHDgm11k0Fvhvr4sT0MwKvrsRkfZZ+0RU+dBLq7zABQoblXiz LvXmGDRYtsgAxgFV22OrEVOfPwwQkY9nDDY+IqCCVLZXhWFsmg4/LUv+ALQdf3lbvcD+ RK007kRBOL+41PGtMMFbCxKluGofmhxReioK1J8giUhekb/E5fxpQymzpICzrHVex6No x2Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=ZTvNHUEU2aY+hxFfexMfY1CkSgdyelDK+IRBD2rClxk=; b=Ga9uUqiQ8W1NAgfNIXrNv+pQNPx/71X7v4R1eADeCJHlEA+FLcwmtS1WdSKqRneBpb a5OjxYHLQl9JI0mHpd48Gv47zlFT80I8KmF/LgO+y/Nmg1dWlrF/bVmlSPShWEa2F+ju coPBFkhWuF2Jo+T0UmWW6oDsG/aKwxCGgKscG+jbwVaB5dLCXFTTdNOxxWVkHLk0hTpV C0C82YgipCg5JqhOgWcJuYMSbH5nfH80vD1eyTKrmJRrZ3WwL2b4FPwQUerphe5g7z+b 2ePjY1bbHg63R9vctpAQ5+nXvjL1eMLqG3UyWh74m4u21jRucI6wq8N9lNIlBxCqpOfP 0Ovw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j4si1043406ejn.341.2020.05.13.19.34.14; Wed, 13 May 2020 19:34:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725946AbgENCcn (ORCPT + 99 others); Wed, 13 May 2020 22:32:43 -0400 Received: from mga17.intel.com ([192.55.52.151]:42676 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725874AbgENCcn (ORCPT ); Wed, 13 May 2020 22:32:43 -0400 IronPort-SDR: 7bilBrIv/Q0bMGmXyKC4QYtzJEWqmZ1rbPYCvvBK74ERM0JW4hNsBqkygDru899RR9mf8Ob/9p hEMtbgN8rs7g== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2020 19:32:43 -0700 IronPort-SDR: kOBrR6NviiqmngpOVTA0rTrYU9PmmIF3aA1kHHQHShcK54ygbj74hHlB4QQXs+S7htFV3Hpez+ Yo7C6o5VJltw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,390,1583222400"; d="scan'208";a="266086967" Received: from yilunxu-optiplex-7050.sh.intel.com (HELO localhost) ([10.239.159.141]) by orsmga006.jf.intel.com with ESMTP; 13 May 2020 19:32:41 -0700 Date: Thu, 14 May 2020 10:29:35 +0800 From: Xu Yilun To: Souptick Joarder Cc: hao.wu@intel.com, mdf@kernel.org, linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] fpga: dfl: afu: Corrected error handling levels Message-ID: <20200514022935.GE29933@yilunxu-OptiPlex-7050> References: <1589397725-29697-1-git-send-email-jrdr.linux@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1589397725-29697-1-git-send-email-jrdr.linux@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch looks good to me. Maybe we could add the Fixes tag: Fixes: fa8dda1edef9 (fpga: dfl: afu: add DFL_FPGA_PORT_DMA_MAP/UNMAP ioctls support) Thanks, Yilun On Thu, May 14, 2020 at 12:52:05AM +0530, Souptick Joarder wrote: > Corrected error handling goto sequnece. Level put_pages should > be called when pinned pages >= 0 && pinned != npages. Level > free_pages should be called when pinned pages < 0. > > Signed-off-by: Souptick Joarder > --- > drivers/fpga/dfl-afu-dma-region.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/fpga/dfl-afu-dma-region.c b/drivers/fpga/dfl-afu-dma-region.c > index 62f9244..5942343 100644 > --- a/drivers/fpga/dfl-afu-dma-region.c > +++ b/drivers/fpga/dfl-afu-dma-region.c > @@ -61,10 +61,10 @@ static int afu_dma_pin_pages(struct dfl_feature_platform_data *pdata, > region->pages); > if (pinned < 0) { > ret = pinned; > - goto put_pages; > + goto free_pages; > } else if (pinned != npages) { > ret = -EFAULT; > - goto free_pages; > + goto put_pages; > } > > dev_dbg(dev, "%d pages pinned\n", pinned); > -- > 1.9.1