Skip to content

Commit 4324d32

Browse files
authored
Merge pull request #14148 from mikaleppanen/nano_coverity_corr_master
Corrected nanostack coverity warnings
2 parents fa2101c + 1e3d32a commit 4324d32

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

connectivity/nanostack/mbed-mesh-api/source/NanostackEMACInterface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class EMACPhy : public NanostackEthernetPhy {
4040
EMAC &emac;
4141
uint8_t mac_addr[6];
4242
int8_t device_id = -1;
43-
phy_device_driver_s phy;
43+
phy_device_driver_s phy = {};
4444
};
4545

4646
// GAH! no handles on the callback. Force a single interface
@@ -238,4 +238,4 @@ nsapi_error_t Nanostack::add_ethernet_interface(EMAC &emac, bool default_if, Onb
238238
nsapi_error_t err = add_ethernet_interface(emac, default_if, &interface);
239239
*interface_out = interface;
240240
return err;
241-
}
241+
}

connectivity/nanostack/mbed-mesh-api/source/NanostackPPPInterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class PPPPhy : public NanostackPPPPhy {
5454
bool active = false;
5555
bool powered_up = false;
5656
int8_t device_id = -1;
57-
phy_device_driver_s phy;
57+
phy_device_driver_s phy = {};
5858
};
5959

6060
nsapi_error_t Nanostack::PPPInterface::initialize()

connectivity/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_random.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ uint32_t arm_random_seed_get(void)
3434
uint32_t result = 0;
3535
#ifdef MBEDTLS_ENTROPY_HARDWARE_ALT
3636
#if defined(MBEDTLS_PLATFORM_C)
37-
mbedtls_platform_setup(NULL);
37+
int ret = mbedtls_platform_setup(NULL);
38+
if (ret != 0) {
39+
return result;
40+
}
3841
#endif /* MBEDTLS_PLATFORM_C */
3942
/* Grab a seed from a function we provide for mbedtls */
4043
size_t len;

0 commit comments

Comments
 (0)