Skip to content

Commit 23abe47

Browse files
Souptick Joardergregkh
authored andcommitted
fpga: dfl: afu: Corrected error handling levels
[ Upstream commit c9d7e3d ] 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. Fixes: fa8dda1 ("fpga: dfl: afu: add DFL_FPGA_PORT_DMA_MAP/UNMAP ioctls support") Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com> Acked-by: Wu Hao <hao.wu@intel.com> Reviewed-by: Xu Yilun <yilun.xu@intel.com> Link: https://lore.kernel.org/r/1589825991-3545-1-git-send-email-jrdr.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 2783eb9 commit 23abe47

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/fpga/dfl-afu-dma-region.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ static int afu_dma_pin_pages(struct dfl_feature_platform_data *pdata,
106106
region->pages);
107107
if (pinned < 0) {
108108
ret = pinned;
109-
goto put_pages;
109+
goto free_pages;
110110
} else if (pinned != npages) {
111111
ret = -EFAULT;
112-
goto free_pages;
112+
goto put_pages;
113113
}
114114

115115
dev_dbg(dev, "%d pages pinned\n", pinned);

0 commit comments

Comments
 (0)