From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasesh Mody Subject: [PATCH 37/53] net/qede/base: handle the error condition properly Date: Mon, 18 Sep 2017 18:51:27 -0700 Message-ID: <1505785903-1741-8-git-send-email-rasesh.mody@cavium.com> References: <1505785903-1741-1-git-send-email-rasesh.mody@cavium.com> Mime-Version: 1.0 Content-Type: text/plain Cc: Rasesh Mody , Dept-EngDPDKDev@cavium.com To: dev@dpdk.org, ferruh.yigit@intel.com Return-path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0058.outbound.protection.outlook.com [104.47.33.58]) by dpdk.org (Postfix) with ESMTP id 87ECF1AEF5 for ; Tue, 19 Sep 2017 03:52:06 +0200 (CEST) In-Reply-To: <1505785903-1741-1-git-send-email-rasesh.mody@cavium.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" If for some reason the send message from VF to PF times out, don't bail out right away without taking proper cleanup action. The goto statement calls ecore_vf_pf_req_end() which will unlock the mutex previously held. Signed-off-by: Rasesh Mody --- drivers/net/qede/base/ecore_vf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/qede/base/ecore_vf.c b/drivers/net/qede/base/ecore_vf.c index 97ed0b7..e84f97a 100644 --- a/drivers/net/qede/base/ecore_vf.c +++ b/drivers/net/qede/base/ecore_vf.c @@ -237,10 +237,8 @@ static enum _ecore_status_t ecore_vf_pf_acquire(struct ecore_hwfn *p_hwfn) /* send acquire request */ rc = ecore_send_msg2pf(p_hwfn, &resp->hdr.status, sizeof(*resp)); - - /* PF timeout */ - if (rc) - return rc; + if (rc != ECORE_SUCCESS) + goto exit; /* copy acquire response from buffer to p_hwfn */ OSAL_MEMCPY(&p_iov->acquire_resp, -- 1.7.10.3