Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1503272ybk; Sat, 16 May 2020 13:26:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwO5o+dco8RSaK4aqCaB+1BSIzOXco96KaNz2vJ7k8+ei8a/Ezwe0b80WwqS/KCSaSeteJb X-Received: by 2002:a17:906:b28f:: with SMTP id q15mr8499040ejz.188.1589660797235; Sat, 16 May 2020 13:26:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589660797; cv=none; d=google.com; s=arc-20160816; b=GuJxnDHPmeLvpLd6EsM0tPpUTqADr+v5SPVCSmiIfCcQ61CxXntwwkOOYBQgy1pswN 3va0UTjUGl+QQ959S5GkMntgjmo2DO7YuMoBpAd6O1J7bW1x+CAOjs0Rab9LRnz9Mo3N 7JlcXCgTUIJMJrHliW2OxO2pKBTxiad7y+6FcignInaL/bzVG1dzZe5YBfC3P+oKCU/I zevSNovi8dHwRWV/STkj2/2Ar1flFoMsDs88ilWHiSCdL0S8dFzKHxy+tonPkRznwCDZ nxQYzfZx5yKakNUZIAtzdHYAYrKJLdYXl2fWH4jRhjNajAuDC6ULF5VrBqhwTi47HYMH QTOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=6KqPhCBNJhZ1XRzaZS7zC4GjdNL+qb+xQbQdcmNhs0M=; b=dZ9qMxifjtYdz/lOkbsni2vOidJrU6nwCICoQGfk/P4Y2gwopqXSKtixQ047UBQBL4 yOLoDmq1k2TRIle1z1GMYgtSrbDv4Y84ZU1EvZZrs5ILjn/gPh/QP2EPJ/Hd8si/0Au3 HTA7ThxcwPnGVTHBt45SL3ck/nDV3VpwybWUcqLpDTc3q0O4Uc0d+iOY5C6DiZ00iymW vcKr0HI441+jpQsnqCoqx3JU6UcKntwsvsC1rXDo8pQimDzkKxwLm9DkOvj+sMQXGyay Vs4dILp93O3Jmt7kkz+MeNCsIiS1Ug3n6HGwgYhhrmxnao5yjJidhq9+/fHnNBOMe7si JL/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EiI9YTaV; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k2si3288185edl.579.2020.05.16.13.26.14; Sat, 16 May 2020 13:26:37 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EiI9YTaV; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726663AbgEPUWn (ORCPT + 99 others); Sat, 16 May 2020 16:22:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726528AbgEPUWn (ORCPT ); Sat, 16 May 2020 16:22:43 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEDB2C061A0C; Sat, 16 May 2020 13:22:42 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id w10so5816603ljo.0; Sat, 16 May 2020 13:22:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6KqPhCBNJhZ1XRzaZS7zC4GjdNL+qb+xQbQdcmNhs0M=; b=EiI9YTaVS3MkuyxxITMvw6mWfcC6HBmzsyG3q8W7vachz5iKebbbH97iymAqUx5a/4 3ZmcKmqCWzxiw0fMAY3U2XX/F1t/smtxadCVakkR3geX9ln1MTmrovISOAZvOQ9SvOgq aRl2e2+t60xBcQRWEyeFyDR/HvA1FsXjMQlvWWnRI9slpksEonINcTxB1lMi5C2h/kty +lXWvPyci8ZScnWB2Yo8I+WN95MZbbT/qHmutFLRtLW66ovPSIvvskI3+l63VDebxOaG +ZKEqU6tWXooDENA+AMiFpbB08Pt9q2UQB5q5vu3xgvViBbzIu0fpDWaS3D8GGwQLRcb Uppw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6KqPhCBNJhZ1XRzaZS7zC4GjdNL+qb+xQbQdcmNhs0M=; b=IneRWqxjq+6gPwQYwBR0sJfRVCtWKTPpyhz7GaNgoD78unHiMGa9Z7R+1ev4UtDg+u tCDBEp5Lzk1ahVKoIwiB8/RdzJuW+dBwsGvFyR2cmXyt7HTOxaVFOwQLXbZVAAdM9a1e xCXiSPSbbobUmkWGte+b3EHBswxogIvQOmCKGhTSZQ3TNHdew6fM894IERadTc+ynL9M 3kgGh/8IooLZjTMv3iccdwuShDBlclaBR2gbWAiRdNhFqWDoTG97/0QCJXRom91mkiln PCpi8NIOPhIj2JL9IlUQcHlvQt9WGPT9tE3JB6X0xCo2qmZwS75ZMDIwgioLkv0a8wm7 UJ0A== X-Gm-Message-State: AOAM530sMvowb0+a9giRK+QLgvwoFqUg1HiBga1WR0jORW/1VNU0GjCb ahxcG7Y3WSXo4MshxARJVlEVaQBDqw1hlA+is0g= X-Received: by 2002:a05:651c:50e:: with SMTP id o14mr6092901ljp.52.1589660561294; Sat, 16 May 2020 13:22:41 -0700 (PDT) MIME-Version: 1.0 References: <1589397725-29697-1-git-send-email-jrdr.linux@gmail.com> <20200514022935.GE29933@yilunxu-OptiPlex-7050> In-Reply-To: From: Souptick Joarder Date: Sun, 17 May 2020 01:52:29 +0530 Message-ID: Subject: Re: [PATCH] fpga: dfl: afu: Corrected error handling levels To: "Wu, Hao" Cc: "mdf@kernel.org" , "linux-fpga@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Xu, Yilun" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 14, 2020 at 11:36 AM Wu, Hao wrote: > > > -----Original Message----- > > From: Xu, Yilun > > Sent: Thursday, May 14, 2020 10:30 AM > > To: Souptick Joarder > > Cc: Wu, Hao ; mdf@kernel.org; linux- > > fpga@vger.kernel.org; linux-kernel@vger.kernel.org > > Subject: Re: [PATCH] fpga: dfl: afu: Corrected error handling levels > > > > 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 for catching this problem. > > With this line, > Acked-by: Wu Hao Thanks. Will post v2. > > Thanks! > Hao > > > > > 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