From e1642b0d38dc9b4ec64e2274ad01015cd0de35d1 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Wed, 8 Jan 2020 08:54:34 +0100 Subject: [PATCH] nimble/drivers: Fix loop condition in nrf51 driver This condition was suggesting that loop can break while om is NULL but this loop breaks only when copied enough bytes and om is expected to have enough space. --- nimble/drivers/nrf51/src/ble_phy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nimble/drivers/nrf51/src/ble_phy.c b/nimble/drivers/nrf51/src/ble_phy.c index 30a0059879..b7e6329721 100644 --- a/nimble/drivers/nrf51/src/ble_phy.c +++ b/nimble/drivers/nrf51/src/ble_phy.c @@ -238,7 +238,7 @@ ble_phy_rxpdu_copy(uint8_t *dptr, struct os_mbuf *rxpdu) om = rxpdu; dst = om->om_data; - while (om) { + while (true) { /* * Always copy blocks of length aligned to word size, only last mbuf * will have remaining non-word size bytes appended.