The HAL has a few comparisons of a pointer with 0U instead of NULL. This patch fixes that. Fixes #5289