* [PATCH] fpga: dfl: afu: Corrected error handling levels
@ 2020-05-13 19:22 Souptick Joarder
2020-05-14 2:29 ` Xu Yilun
0 siblings, 1 reply; 4+ messages in thread
From: Souptick Joarder @ 2020-05-13 19:22 UTC (permalink / raw)
To: hao.wu, mdf; +Cc: linux-fpga, linux-kernel, Souptick Joarder
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 <jrdr.linux@gmail.com>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] fpga: dfl: afu: Corrected error handling levels
2020-05-13 19:22 [PATCH] fpga: dfl: afu: Corrected error handling levels Souptick Joarder
@ 2020-05-14 2:29 ` Xu Yilun
2020-05-14 6:06 ` Wu, Hao
0 siblings, 1 reply; 4+ messages in thread
From: Xu Yilun @ 2020-05-14 2:29 UTC (permalink / raw)
To: Souptick Joarder; +Cc: hao.wu, mdf, linux-fpga, linux-kernel
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 <jrdr.linux@gmail.com>
> ---
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH] fpga: dfl: afu: Corrected error handling levels
2020-05-14 2:29 ` Xu Yilun
@ 2020-05-14 6:06 ` Wu, Hao
2020-05-16 20:22 ` Souptick Joarder
0 siblings, 1 reply; 4+ messages in thread
From: Wu, Hao @ 2020-05-14 6:06 UTC (permalink / raw)
To: Souptick Joarder; +Cc: mdf, linux-fpga, linux-kernel, Xu, Yilun
> -----Original Message-----
> From: Xu, Yilun <yilun.xu@intel.com>
> Sent: Thursday, May 14, 2020 10:30 AM
> To: Souptick Joarder <jrdr.linux@gmail.com>
> Cc: Wu, Hao <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
>
> 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 <hao.wu@intel.com>
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 <jrdr.linux@gmail.com>
> > ---
> > 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] fpga: dfl: afu: Corrected error handling levels
2020-05-14 6:06 ` Wu, Hao
@ 2020-05-16 20:22 ` Souptick Joarder
0 siblings, 0 replies; 4+ messages in thread
From: Souptick Joarder @ 2020-05-16 20:22 UTC (permalink / raw)
To: Wu, Hao; +Cc: mdf, linux-fpga, linux-kernel, Xu, Yilun
On Thu, May 14, 2020 at 11:36 AM Wu, Hao <hao.wu@intel.com> wrote:
>
> > -----Original Message-----
> > From: Xu, Yilun <yilun.xu@intel.com>
> > Sent: Thursday, May 14, 2020 10:30 AM
> > To: Souptick Joarder <jrdr.linux@gmail.com>
> > Cc: Wu, Hao <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
> >
> > 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 <hao.wu@intel.com>
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 <jrdr.linux@gmail.com>
> > > ---
> > > 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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-05-16 20:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-13 19:22 [PATCH] fpga: dfl: afu: Corrected error handling levels Souptick Joarder
2020-05-14 2:29 ` Xu Yilun
2020-05-14 6:06 ` Wu, Hao
2020-05-16 20:22 ` Souptick Joarder
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.