fpga: dfl: afu: Corrected error handling levels
Subsystems (2)
PATCH 1/1 fpga: dfl: afu: Corrected error handling levels
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.
--- drivers/fpga/dfl-afu-dma-region.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/fpga/dfl-afu-dma-region.c +2 -2
@@ -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);
Signature · 1 line
1.9.1
Xu Yilun
maintainerThe patch looks good to me.
Maybe we could add the Fixes tag:
Thanks,
Yilun
Quoted 28 lines · Souptick Joarder
Corrected error handling goto sequnece. Level
put_pagesshould be called when pinned pages >= 0 && pinned != npages. Levelfree_pagesshould be called when pinned pages < 0.Signed-off-by Souptick Joarder <[email protected]>--- drivers/fpga/dfl-afu-dma-region.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/fpga/dfl-afu-dma-region.c +2
-2@@ -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);Signature · 1 line
1.9.1
Wu, Hao
Acked-byQuoted 8 lines
-----Original Message-----
From: Xu, Yilun <[email protected]>
Sent: Thursday, May 14, 2020 10:30 AM
To: Souptick Joarder <[email protected]>
Cc: Wu, Hao <[email protected]>; [email protected]; linux- [email protected]; [email protected]
Subject: Re: [PATCH] fpga: dfl: afu: Corrected error handling levels
Quoted 5 lines
The patch looks good to me.
Maybe we could add the Fixes tag:
Fixes fa8dda1edef9 (fpga: dfl: afu: addDFL_FPGA_PORT_DMA_MAP/UNMAP ioctls support)
Thanks for catching this problem.
With this line,
Thanks!
Hao
Quoted 35 lines
Thanks,
Yilundrivers/fpga/dfl-afu-dma-
Quoted 10 lines · Souptick Joarder
Corrected error handling goto sequnece. Level
put_pagesshould be called when pinned pages >= 0 && pinned != npages. Levelfree_pagesshould be called when pinned pages < 0.Signed-off-by Souptick Joarder <[email protected]>--- drivers/fpga/dfl-afu-dma-region.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/fpga/dfl-afu-dma- renamed from drivers/fpga/dfl-afu-dma-region.c +0
-0
region.cdrivers/fpga/dfl-afu-dma-region.c static int afu_dma_pin_pages(struct
Quoted 4 lines
index 62f9244..5942343 100644
drivers/fpga/dfl-afu-dma-region.c +0
-0@@ -61,10 +61,10 @@ static int afu_dma_pin_pages(struct
dfl_feature_platform_data*pdata,Quoted 14 lines
drivers/fpga/dfl-afu-dma-region.c +2
-3region->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
Quoted 11 lines · Hao
Quoted 11 lines
-----Original Message-----
From: Xu, Yilun <[email protected]>
Sent: Thursday, May 14, 2020 10:30 AM
To: Souptick Joarder <[email protected]>
Cc: Wu, Hao <[email protected]>; [email protected]; linux- [email protected]; [email protected]
Subject: Re: [PATCH] fpga: dfl: afu: Corrected error handling levelsThe patch looks good to me.
Quoted 8 lines
Quoted 3 lines
Maybe we could add the Fixes tag:
Fixes fa8dda1edef9 (fpga: dfl: afu: addDFL_FPGA_PORT_DMA_MAP/UNMAP ioctls support)
Thanks for catching this problem.
With this line,
Acked-by Wu Hao <[email protected]>
Thanks. Will post v2.
Quoted 39 lines
Thanks!
HaoQuoted 35 lines
Thanks,
Yilundrivers/fpga/dfl-afu-dma-
Quoted 10 lines · Souptick Joarder
Corrected error handling goto sequnece. Level
put_pagesshould be called when pinned pages >= 0 && pinned != npages. Levelfree_pagesshould be called when pinned pages < 0.Signed-off-by Souptick Joarder <[email protected]>--- drivers/fpga/dfl-afu-dma-region.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/fpga/dfl-afu-dma- renamed from drivers/fpga/dfl-afu-dma-region.c +0
-0
region.cdrivers/fpga/dfl-afu-dma-region.c static int afu_dma_pin_pages(struct
Quoted 4 lines
index 62f9244..5942343 100644
drivers/fpga/dfl-afu-dma-region.c +0
-0@@ -61,10 +61,10 @@ static int afu_dma_pin_pages(struct
dfl_feature_platform_data*pdata,Quoted 14 lines
drivers/fpga/dfl-afu-dma-region.c +2
-3region->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