OSDN Git Service

etnaviv: Avoid infinite loop in find_frame()
authorChristian Gmeiner <christian.gmeiner@gmail.com>
Tue, 31 Jan 2017 08:10:27 +0000 (09:10 +0100)
committerChristian Gmeiner <christian.gmeiner@gmail.com>
Tue, 31 Jan 2017 08:19:25 +0000 (09:19 +0100)
commit82fe240a9912d78bc2eec513c1139c918c5f189f
tree7b94432dee271b4d0f25df333812062f3582c7b7
parent8477aa71d902d6a6fd89741151f8d119a72a7dc0
etnaviv: Avoid infinite loop in find_frame()

Use of unsigned loop control variable with '>= 0' would lead
to infinite loop.

Reported by clang:

etnaviv_compiler.c:1024:39: warning: comparison of unsigned expression
>= 0 is always true [-Wtautological-compare]
   for (unsigned sp = c->frame_sp; sp >= 0; sp--)
                                   ~~ ^  ~

v2: Simply use the same datatype as c->frame_sp is using.

CC: <mesa-stable@lists.freedesktop.org>
Reported-by: Rhys Kidd <rhyskidd@gmail.com>
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rhys Kidd <rhyskidd@gmail.com>
src/gallium/drivers/etnaviv/etnaviv_compiler.c