Merge "hal: Fixes for the issues reported by KlocWork"