[2/2] vhost: release the locks when failed to make RARP packet

Message ID 20180726013721.30200-2-tiwei.bie@intel.com (mailing list archive)
State Accepted, archived
Headers
Series [1/2] vhost: fix overflow on shadow used ring |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Tiwei Bie July 26, 2018, 1:37 a.m. UTC
  Fixes: eefac9536a90 ("vhost: postpone device creation until rings are mapped")
Cc: stable@dpdk.org

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
---
 lib/librte_vhost/virtio_net.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Jens Freimann July 26, 2018, 7:22 a.m. UTC | #1
On Thu, Jul 26, 2018 at 09:37:21AM +0800, Tiwei Bie wrote:
>Fixes: eefac9536a90 ("vhost: postpone device creation until rings are mapped")
>Cc: stable@dpdk.org
>
>Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
>---
> lib/librte_vhost/virtio_net.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>

Reviewed-by: Jens Freimann <jfreimann@redhat.com>
  

Patch

diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
index 3b11b353c..b02651275 100644
--- a/lib/librte_vhost/virtio_net.c
+++ b/lib/librte_vhost/virtio_net.c
@@ -1626,7 +1626,8 @@  rte_vhost_dequeue_burst(int vid, uint16_t queue_id,
 		if (rarp_mbuf == NULL) {
 			RTE_LOG(ERR, VHOST_DATA,
 				"Failed to make RARP packet.\n");
-			return 0;
+			count = 0;
+			goto out;
 		}
 		count -= 1;
 	}