From cda251fc8bcf57454a2573d5cd097666a88efe72 Mon Sep 17 00:00:00 2001
From: Manish Rangankar <manish.rangankar@cavium.com>
Date: Tue, 14 Aug 2018 02:15:20 -0400
Subject: [PATCH] iscsiuio: Release xmit_mutex in error code path.
This prevents iscsiuio seg fault in case get_tx_pkt fails
while sending ARP.
Signed-off-by: Manish Rangankar <manish.rangankar@cavium.com>
---
iscsiuio/src/unix/libs/cnic.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/iscsiuio/src/unix/libs/cnic.c b/iscsiuio/src/unix/libs/cnic.c
index 4ff61e7ad596..9cdf933f1f23 100644
--- a/iscsiuio/src/unix/libs/cnic.c
+++ b/iscsiuio/src/unix/libs/cnic.c
@@ -114,6 +114,7 @@ static int cnic_arp_send(nic_t *nic, nic_interface_t *nic_iface, int fd,
eth = (*nic->ops->get_tx_pkt) (nic);
if (eth == NULL) {
LOG_WARN(PFX "%s: couldn't get tx packet", nic->log_name);
+ pthread_mutex_unlock(&nic->xmit_mutex);
return -EAGAIN;
}
--
2.17.2