Merge "hal: check the pointer before dereference"