* [PATCH] cisco: enic: Fic an error handling path in 'vnic_dev_init_devcmd2()'
@ 2017-07-08 4:51 Christophe JAILLET
2017-07-11 17:54 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2017-07-08 4:51 UTC (permalink / raw)
To: benve, govind, neepatel
Cc: netdev, linux-kernel, kernel-janitors, Christophe JAILLET
if 'ioread32()' returns 0xFFFFFFF, we have to go through the error
handling path as done everywhere else in this function.
Move the 'err_free_wq' label to better match its name and its location
and add a new label 'err_disable_wq'.
Update the code accordingly.
Fixes: 373fb0873d43 ("enic: add devcmd2")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/net/ethernet/cisco/enic/vnic_dev.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/cisco/enic/vnic_dev.c b/drivers/net/ethernet/cisco/enic/vnic_dev.c
index 1841ad45d215..39bad67422dd 100644
--- a/drivers/net/ethernet/cisco/enic/vnic_dev.c
+++ b/drivers/net/ethernet/cisco/enic/vnic_dev.c
@@ -402,8 +402,8 @@ static int vnic_dev_init_devcmd2(struct vnic_dev *vdev)
fetch_index = ioread32(&vdev->devcmd2->wq.ctrl->fetch_index);
if (fetch_index == 0xFFFFFFFF) { /* check for hardware gone */
vdev_err(vdev, "Fatal error in devcmd2 init - hardware surprise removal\n");
-
- return -ENODEV;
+ err = -ENODEV;
+ goto err_free_wq;
}
enic_wq_init_start(&vdev->devcmd2->wq, 0, fetch_index, fetch_index, 0,
@@ -414,7 +414,7 @@ static int vnic_dev_init_devcmd2(struct vnic_dev *vdev)
err = vnic_dev_alloc_desc_ring(vdev, &vdev->devcmd2->results_ring,
DEVCMD2_RING_SIZE, DEVCMD2_DESC_SIZE);
if (err)
- goto err_free_wq;
+ goto err_disable_wq;
vdev->devcmd2->result = vdev->devcmd2->results_ring.descs;
vdev->devcmd2->cmd_ring = vdev->devcmd2->wq.ring.descs;
@@ -433,8 +433,9 @@ static int vnic_dev_init_devcmd2(struct vnic_dev *vdev)
err_free_desc_ring:
vnic_dev_free_desc_ring(vdev, &vdev->devcmd2->results_ring);
-err_free_wq:
+err_disable_wq:
vnic_wq_disable(&vdev->devcmd2->wq);
+err_free_wq:
vnic_wq_free(&vdev->devcmd2->wq);
err_free_devcmd2:
kfree(vdev->devcmd2);
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] cisco: enic: Fic an error handling path in 'vnic_dev_init_devcmd2()'
2017-07-08 4:51 [PATCH] cisco: enic: Fic an error handling path in 'vnic_dev_init_devcmd2()' Christophe JAILLET
@ 2017-07-11 17:54 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-07-11 17:54 UTC (permalink / raw)
To: christophe.jaillet
Cc: benve, govind, neepatel, netdev, linux-kernel, kernel-janitors
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Date: Sat, 8 Jul 2017 06:51:35 +0200
> if 'ioread32()' returns 0xFFFFFFF, we have to go through the error
> handling path as done everywhere else in this function.
>
> Move the 'err_free_wq' label to better match its name and its location
> and add a new label 'err_disable_wq'.
> Update the code accordingly.
>
> Fixes: 373fb0873d43 ("enic: add devcmd2")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Looks good, applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-07-11 17:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-08 4:51 [PATCH] cisco: enic: Fic an error handling path in 'vnic_dev_init_devcmd2()' Christophe JAILLET
2017-07-11 17:54 ` 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).