KVM: s390/mm: Clarification for two return value checks in gmap_shadow()

From: Markus Elfring
Date: Sat May 02 2020 - 11:43:18 EST


Hello,

I have tried another small script out for the semantic patch language.
This source code analysis approach points out that the function âgmap_find_shadowâ
is called two times by the function âgmap_shadowâ.
https://elixir.bootlin.com/linux/v5.7-rc3/source/arch/s390/mm/gmap.c#L1628
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/log/arch/s390/mm/gmap.c

Null pointer checks are performed at these places.
The function âgmap_find_shadowâ is documented in the same source file
that the pointer âERR_PTR(-EAGAIN)â can eventually be returned.
Are the referenced gmap data structures always initialised here?

Regards,
Markus