eppolicymap: exit if inner map creation fails, to avoid nil dereference
eppolicymap: exit if inner map creation fails, to avoid nil dereference

In eppolicymap.CreateWithName(), if the policy map creation in the
buildMap.Do() block fails for whatever reason, we return early and
EpPolicyMap remains nil. Calling OpenOrCreate() a few lines below
attempts to dereference that pointer to take its lock.

Ouch.

EpPolicyMap used to be created unconditionally, even if the policy map
creation would fail. This was changed in commit b384ce85bb83. We could
restore this behaviour, or we can simply exit early if inner map
creation fails, by producing a fatal error message. Let's do the latter,
as there is no point in proceeding with the creation of endpoint policy
map if creating the inner map failed.

Fixes: b384ce85bb83 ("eppolicymap: Factor out for better testing")
Signed-off-by: Quentin Monnet <d6b8e48afb2534b213e391cab43016505747a234@isovalent.com>

cilium-team/cilium,tgraf/cilium,cilium/cilium,tklauser/cilium,tklauser/cilium,tgraf/cilium,michi-covalent/cilium,michi-covalent/cilium,tgraf/cilium,tgraf/cilium,cilium/cilium,cilium/cilium,tklauser/cilium,michi-covalent/cilium,michi-covalent/cilium,cilium-team/cilium,tklauser/cilium,cilium/cilium,tgraf/cilium,cilium/cilium,tklauser/cilium,michi-covalent/cilium,tgraf/cilium