summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-04-22 21:07:28 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-04-22 21:07:28 +0000
commitabf896571c4dbae29374f4509ef761c2c8179738 (patch)
treeb0c9e3d2fafcbe1f9f8bff46ed4fca6b24a75eac
parentcbc9c52c05673a9260633ea38da0901732a111fa (diff)
parent00f95883c2c1dc0d583a6bed4dacf8c31d561de6 (diff)
downloadgchips-abf896571c4dbae29374f4509ef761c2c8179738.tar.gz
Change-Id: Ia21238dcf80faf4f0b9196a9fdb46cefecdd9ae2
-rw-r--r--gralloc4/src/core/mali_gralloc_reference.cpp19
1 files changed, 1 insertions, 18 deletions
diff --git a/gralloc4/src/core/mali_gralloc_reference.cpp b/gralloc4/src/core/mali_gralloc_reference.cpp
index b73c08b..954c2b3 100644
--- a/gralloc4/src/core/mali_gralloc_reference.cpp
+++ b/gralloc4/src/core/mali_gralloc_reference.cpp
@@ -76,16 +76,6 @@ private:
return 0;
}
- for (auto i = 0; i < MAX_BUFFER_FDS; i++) {
- auto size = get_buffer_size(hnd->fds[i]);
- auto size_padding = size - (off_t)hnd->alloc_sizes[i];
- if ((size != -1) && ((size_padding < 0) || (size_padding > PAGE_SIZE))){
- MALI_GRALLOC_LOGE("Found an imported buffer with out-of-bounds size %" PRIu64 "",
- hnd->alloc_sizes[i]);
- return -EINVAL;
- }
- }
-
int error = mali_gralloc_ion_map(hnd);
if (error != 0) {
return error;
@@ -125,7 +115,7 @@ private:
} else {
for (auto i = 0; i < MAX_BUFFER_FDS; i++) {
if (hnd->bases[i] != 0 || data.bases[i] != nullptr) {
- MALI_GRALLOC_LOGE("Validation failed: Expected nullptr for unmapped buffer");
+ MALI_GRALLOC_LOGE("Validation failed: Expected nullptr for unmaped buffer");
return -EINVAL;
}
}
@@ -134,13 +124,6 @@ private:
return 0;
}
- off_t get_buffer_size(unsigned int fd) {
- off_t current = lseek(fd, 0, SEEK_CUR);
- off_t size = lseek(fd, 0, SEEK_END);
- lseek(fd, current, SEEK_SET);
- return size;
- }
-
public:
static BufferManager &getInstance() {
static BufferManager instance;