Update codebase with static analysis result

There were some issues reported by code static analysis tool. This
change includes update from the result with applicable items.

Test: cf booted & atest passed
Change-Id: I7d8e4e6c8dc1fc5893ab1d2365eb64fce47db220
Merged-In: I7d8e4e6c8dc1fc5893ab1d2365eb64fce47db220
8 files changed