parser: check the proper token number

In qmi_message_parse(), a check is made to ensure members defined
for a message are unique, both in name and number.  But the number
that's used in the comparison is the type token number, but should
be the member number token number.  Fix this bug.

Fixes: 72d1687 ("parser: disallow duplicate members")
Signed-off-by: Alex Elder <elder@linaro.org>
This commit is contained in:
Alex Elder 2021-10-08 16:04:48 -05:00
parent ed896c97dc
commit 4937e55261

View File

@ -492,7 +492,7 @@ static void qmi_message_parse(enum message_type message_type)
if (!strcmp(qmm->name, id_tok.str))
yyerror("duplicate message member \"%s\"",
qmm->name);
if (qmm->id == type_tok.num)
if (qmm->id == num_tok.num)
yyerror("duplicate message member number %u",
qmm->id);
}