cppcheck: fix Possible inefficient checking

Change-Id: I71449d40875970aa49320ae86a3104d132f5d5e9