mesh: Remove redundant AD parsing check

A few lines earlier the code bails out in case len is 0. Checking for
buf->len < 1 is the same as checking for buf->len == 0. Since len is
guaranteed to be > 0 here the check len > buf->len implicitly checks
for buf->len == 0, i.e. the second test can be removed.

X-Original-Commit: 7334e9616f742303cf848cd30ccb321758735320
This commit is contained in:
Michał Narajowski
2018-02-16 12:11:56 +01:00
parent ca7e104c14
commit 074d32d4b5
+1 -1
View File
@@ -258,7 +258,7 @@ static void bt_mesh_scan_cb(const bt_addr_le_t *addr, s8_t rssi,
return;
}
if (len > buf->om_len || buf->om_len < 1) {
if (len > buf->om_len) {
BT_WARN("AD malformed");
return;
}