summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/commonlib/region.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/commonlib/region.c b/src/commonlib/region.c
index 838107f312..ac0faf111f 100644
--- a/src/commonlib/region.c
+++ b/src/commonlib/region.c
@@ -74,6 +74,9 @@ void *rdev_mmap(const struct region_device *rd, size_t offset, size_t size)
rdev = rdev_root(rd);
+ if (rdev->ops->mmap == NULL)
+ return NULL;
+
return rdev->ops->mmap(rdev, req.offset, req.size);
}
@@ -83,6 +86,9 @@ int rdev_munmap(const struct region_device *rd, void *mapping)
rdev = rdev_root(rd);
+ if (rdev->ops->munmap == NULL)
+ return -1;
+
return rdev->ops->munmap(rdev, mapping);
}