removed potential invalid return value in BWT
authorjihwan.seo <jihwan.seo@samsung.com>
Fri, 29 Jul 2016 04:32:45 +0000 (13:32 +0900)
committerAshok Babu Channa <ashok.channa@samsung.com>
Thu, 4 Aug 2016 05:30:23 +0000 (05:30 +0000)
Change-Id: I33b552f79d18322d60e188420e57c13976218531
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/9857
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Hyuna Jo <hyuna0213.jo@samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
resource/csdk/connectivity/src/cablockwisetransfer.c

index a6a9cf5bc27352779c407786337eaf2a4d14e34f..5463b32d0767d5c32349416e64ff8e9686d6cca6 100644 (file)
@@ -875,15 +875,16 @@ CAResult_t CASetNextBlockOption1(coap_pdu_t *pdu, const CAEndpoint_t *endpoint,
         return CA_STATUS_FAILED;
     }
 
+    CAResult_t res = CA_STATUS_OK;
     CABlockData_t *data = CACheckTheExistOfBlockData(blockDataID, pdu, endpoint,
                                                      COAP_OPTION_BLOCK1);
     if (!data)
     {
         OIC_LOG(ERROR, TAG, "Failed to create or get block data");
+        res = CA_STATUS_FAILED;
         goto exit;
     }
 
-    CAResult_t res = CA_STATUS_OK;
     uint8_t blockWiseStatus = CA_BLOCK_UNKNOWN;
     uint32_t code = pdu->hdr->coap_hdr_udp_t.code;
     if (CA_GET == code || CA_POST == code || CA_PUT == code || CA_DELETE == code)
@@ -1017,15 +1018,16 @@ CAResult_t CASetNextBlockOption2(coap_pdu_t *pdu, const CAEndpoint_t *endpoint,
         return CA_STATUS_FAILED;
     }
 
+    CAResult_t res = CA_STATUS_OK;
     CABlockData_t *data = CACheckTheExistOfBlockData(blockDataID, pdu, endpoint,
                                                      COAP_OPTION_BLOCK2);
     if (!data)
     {
         OIC_LOG(ERROR, TAG, "Failed to create or get block data");
+        res = CA_STATUS_FAILED;
         goto exit;
     }
 
-    CAResult_t res = CA_STATUS_OK;
     uint8_t blockWiseStatus = CA_BLOCK_UNKNOWN;
     if (0 == block.num && CA_GET == pdu->hdr->coap_hdr_udp_t.code && 0 == block.m)
     {