No need to do
vfree/kfree can cope with NULL pointers.
Again, just kfree(xxx)/vfree(xxx)
Always returns 0, consider changing to static void
Consider initialising err to -EINVAL at declaration time, and get rid of
and this one.
From this it would appear that if the region data can't be mapped XIP
(i.e. it is compressed or on a block device), it is cached in its
entirety in RAM?
This implies for block devices that the entire filesystem metadata has
to be cached in RAM. This severely limits the size of AXFS filesystems
when using block devices, or the else memory usage will be excessive.
Just do kfree(xxx)