kdb: Fix handling of kallsyms_symbol_next() return value
authorDaniel Thompson <daniel.thompson@linaro.org>
Mon, 2 Mar 2015 14:13:36 +0000 (14:13 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 3 Mar 2018 15:50:44 +0000 (15:50 +0000)
commitf89c8a7e32a17375a8991efdce0aedc35be91b18
treea6110f106d4e9a871b727b242ccf2d73be70efef
parentc51f80d4d3a47dbc97b9b1b67d81e763afe9c398
kdb: Fix handling of kallsyms_symbol_next() return value

commit c07d35338081d107e57cf37572d8cc931a8e32e2 upstream.

kallsyms_symbol_next() returns a boolean (true on success). Currently
kdb_read() tests the return value with an inequality that
unconditionally evaluates to true.

This is fixed in the obvious way and, since the conditional branch is
supposed to be unreachable, we also add a WARN_ON().

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
kernel/debug/kdb/kdb_io.c