The iterator variable of list_for_each is never NULL. if (1 || A) is always true. Use break if entry found. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>