提交 84d9d071 编写于 作者: J Johan Hedberg 提交者: Gustavo Padovan

Bluetooth: Don't increment twice in eir_has_data_type()

The parsed variable is already incremented inside the for-loop so there
no need to increment it again (not to mention that the code was
incrementing it the wrong amount).
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
Acked-by: NMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: NGustavo Padovan <gustavo@padovan.org>
上级 8d7e1c7f
......@@ -907,11 +907,10 @@ static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status,
static inline bool eir_has_data_type(u8 *data, size_t data_len, u8 type)
{
u8 field_len;
size_t parsed;
size_t parsed = 0;
for (parsed = 0; parsed < data_len - 1; parsed += field_len) {
field_len = data[0];
while (parsed < data_len - 1) {
u8 field_len = data[0];
if (field_len == 0)
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册