This is an automated email from the ASF dual-hosted git repository.
janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
The following commit(s) were added to refs/heads/master by this push:
new e1642b0 nimble/drivers: Fix loop condition in nrf51 driver
e1642b0 is described below
commit e1642b0d38dc9b4ec64e2274ad01015cd0de35d1
Author: Szymon Janc <[email protected]>
AuthorDate: Wed Jan 8 08:54:34 2020 +0100
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 30a0059..b7e6329 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.