qcacmn: Replace A_TARGET_ACCESS_BEGIN/END_RET_PTR

Macros should not alter the execution of function bodies.
Fix possible memory leaks that this cleanup exposed.

Change-Id: I546c5822d7c28e0c9dd77094a5bb0f7e3e7544d4
CRs-Fixed: 986480
diff --git a/hif/src/ce/ce_service.c b/hif/src/ce/ce_service.c
index a3e77ab..2341f83 100644
--- a/hif/src/ce/ce_service.c
+++ b/hif/src/ce/ce_service.c
@@ -652,6 +652,14 @@
 }
 #endif /* WLAN_FEATURE_FASTPATH */
 
+/**
+ * ce_recv_buf_enqueue() - enqueue a recv buffer into a copy engine
+ * @coyeng: copy engine handle
+ * @per_recv_context: virtual address of the nbuf
+ * @buffer: physical address of the nbuf
+ *
+ * Return: 0 if the buffer is enqueued
+ */
 int
 ce_recv_buf_enqueue(struct CE_handle *copyeng,
 		    void *per_recv_context, qdf_dma_addr_t buffer)
@@ -663,7 +671,6 @@
 	unsigned int nentries_mask = dest_ring->nentries_mask;
 	unsigned int write_index;
 	unsigned int sw_index;
-	int val = 0;
 	uint64_t dma_addr = buffer;
 	struct hif_softc *scn = CE_state->scn;
 
@@ -671,10 +678,9 @@
 	write_index = dest_ring->write_index;
 	sw_index = dest_ring->sw_index;
 
-	A_TARGET_ACCESS_BEGIN_RET_EXT(scn, val);
-	if (val == -1) {
+	if (Q_TARGET_ACCESS_BEGIN(scn) < 0) {
 		qdf_spin_unlock_bh(&CE_state->ce_index_lock);
-		return val;
+		return -EIO;
 	}
 
 	if (CE_RING_DELTA(nentries_mask, write_index, sw_index - 1) > 0) {
@@ -707,14 +713,8 @@
 	} else {
 		status = QDF_STATUS_E_FAILURE;
 	}
-	A_TARGET_ACCESS_END_RET_EXT(scn, val);
-	if (val == -1) {
-		qdf_spin_unlock_bh(&CE_state->ce_index_lock);
-		return val;
-	}
-
+	Q_TARGET_ACCESS_END(scn);
 	qdf_spin_unlock_bh(&CE_state->ce_index_lock);
-
 	return status;
 }