linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rocker: fix incorrect error handling in dma_rings_init
@ 2020-06-12 20:27 Aditya Pakki
  2020-06-15 20:38 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Aditya Pakki @ 2020-06-12 20:27 UTC (permalink / raw)
  To: pakki001
  Cc: kjlu, wu000273, Jiri Pirko, David S. Miller, Jakub Kicinski,
	netdev, linux-kernel

In rocker_dma_rings_init, the goto blocks in case of errors
caused by the functions rocker_dma_cmd_ring_waits_alloc() and
rocker_dma_ring_create() are incorrect. The patch fixes the
order consistent with cleanup in rocker_dma_rings_fini().

Signed-off-by: Aditya Pakki <pakki001@umn.edu>
---
 drivers/net/ethernet/rocker/rocker_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/rocker/rocker_main.c b/drivers/net/ethernet/rocker/rocker_main.c
index 7585cd2270ba..fc99e7118e49 100644
--- a/drivers/net/ethernet/rocker/rocker_main.c
+++ b/drivers/net/ethernet/rocker/rocker_main.c
@@ -647,10 +647,10 @@ static int rocker_dma_rings_init(struct rocker *rocker)
 err_dma_event_ring_bufs_alloc:
 	rocker_dma_ring_destroy(rocker, &rocker->event_ring);
 err_dma_event_ring_create:
+	rocker_dma_cmd_ring_waits_free(rocker);
+err_dma_cmd_ring_waits_alloc:
 	rocker_dma_ring_bufs_free(rocker, &rocker->cmd_ring,
 				  PCI_DMA_BIDIRECTIONAL);
-err_dma_cmd_ring_waits_alloc:
-	rocker_dma_cmd_ring_waits_free(rocker);
 err_dma_cmd_ring_bufs_alloc:
 	rocker_dma_ring_destroy(rocker, &rocker->cmd_ring);
 	return err;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] rocker: fix incorrect error handling in dma_rings_init
  2020-06-12 20:27 [PATCH] rocker: fix incorrect error handling in dma_rings_init Aditya Pakki
@ 2020-06-15 20:38 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-06-15 20:38 UTC (permalink / raw)
  To: pakki001; +Cc: kjlu, wu000273, jiri, kuba, netdev, linux-kernel

From: Aditya Pakki <pakki001@umn.edu>
Date: Fri, 12 Jun 2020 15:27:55 -0500

> In rocker_dma_rings_init, the goto blocks in case of errors
> caused by the functions rocker_dma_cmd_ring_waits_alloc() and
> rocker_dma_ring_create() are incorrect. The patch fixes the
> order consistent with cleanup in rocker_dma_rings_fini().
> 
> Signed-off-by: Aditya Pakki <pakki001@umn.edu>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-15 20:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-12 20:27 [PATCH] rocker: fix incorrect error handling in dma_rings_init Aditya Pakki
2020-06-15 20:38 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).