Release spinlock in case of sock_send failure to RM server
authorTinku Mannan <tmannan@ti.com>
Thu, 22 May 2014 19:19:12 +0000 (15:19 -0400)
committerTinku Mannan <tmannan@ti.com>
Thu, 22 May 2014 19:19:12 +0000 (15:19 -0400)
ti/runtime/netapi/utils/netapi_util_rm.c

index d1bf3fc8d17a332336923e2dc9a5c9d58d1a5939..79281df330f44e79a24398d576b185b6f49bb34c 100755 (executable)
@@ -238,7 +238,7 @@ void transportReceive (void)
 
     /* Provide packet to RM Client for processing */       
     if ((rm_result = Rm_receivePacket(rmTransportMap[SERVER_TO_CLIENT_MAP_ENTRY].transportHandle, rm_pkt))) {
-        printf("RM failed to process received packet: %d\n", rm_result);
+        printf("RM failed to process received packet !!: %d\n", rm_result);
     }
 
     transportFree(rm_pkt);
@@ -250,10 +250,11 @@ int32_t transportSendRcv (Rm_AppTransportHandle appTransport, Rm_PacketHandle pk
     Rm_Packet   *rm_pkt = (Rm_Packet *)pktHandle;
 
     hplib_mSpinLockLock(&net_test_rm_lock);
-    if (sock_send(rmClientSocket, (char *)rm_pkt, (int) rm_pkt->pktLenBytes, server_sock_name)) {
-        printf("send data failed\n");
+    if (sock_send(rmClientSocket, (char *)rm_pkt, (int) rm_pkt->pktLenBytes, server_sock_name))
+    {
+        hplib_mSpinLockUnlock(&net_test_rm_lock);
+        return (-1);
     }
-
     /* Wait for response from Server */
     transportReceive();
     hplib_mSpinLockUnlock(&net_test_rm_lock);