diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-04-22 21:07:28 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-04-22 21:07:28 +0000 |
commit | abf896571c4dbae29374f4509ef761c2c8179738 (patch) | |
tree | b0c9e3d2fafcbe1f9f8bff46ed4fca6b24a75eac | |
parent | cbc9c52c05673a9260633ea38da0901732a111fa (diff) | |
parent | 00f95883c2c1dc0d583a6bed4dacf8c31d561de6 (diff) | |
download | gchips-abf896571c4dbae29374f4509ef761c2c8179738.tar.gz |
Merge cherrypicks of [17898284] into sc-qpr3-release.android-12.1.0_r9android-12.1.0_r8android-12.1.0_r7android-12.1.0_r22android-12.1.0_r21android-12.1.0_r20android-12.1.0_r19android-12.1.0_r11android-12.1.0_r10android12-qpr3-s7-releaseandroid12-qpr3-s6-releaseandroid12-qpr3-s5-releaseandroid12-qpr3-s4-releaseandroid12-qpr3-s3-releaseandroid12-qpr3-s2-releaseandroid12-qpr3-s1-releaseandroid12-qpr3-release
Change-Id: Ia21238dcf80faf4f0b9196a9fdb46cefecdd9ae2
-rw-r--r-- | gralloc4/src/core/mali_gralloc_reference.cpp | 19 |
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; |