Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9b5bf692 authored by Tianyu Jiang's avatar Tianyu Jiang
Browse files

Revert "Fix return error."

This reverts commit 9ce7bfa3.

Reason for revert: should check whether the allocated buffer count is the same as requested buffer count, rather than not equals zero. This is because there is a use case when bufferhub queue is created without allocated buffers.

Bug: 115573986

Change-Id: I5a0dc67e6631248a019f3af95b801e2bb7f6d6be
parent 9ce7bfa3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -484,7 +484,7 @@ Status<std::vector<size_t>> ProducerQueue::AllocateBuffers(
  if (buffer_slots.size() == 0) {
    // Error out if no buffer is allocated and improted.
    ALOGE_IF(TRACE, "ProducerQueue::AllocateBuffers: no buffer allocated.");
    return ErrorStatus(ENOMEM);
    ErrorStatus(ENOMEM);
  }

  return {std::move(buffer_slots)};
@@ -505,7 +505,7 @@ Status<size_t> ProducerQueue::AllocateBuffer(uint32_t width, uint32_t height,

  if (status.get().size() == 0) {
    ALOGE_IF(TRACE, "ProducerQueue::AllocateBuffer: no buffer allocated.");
    return ErrorStatus(ENOMEM);
    ErrorStatus(ENOMEM);
  }

  return {status.get()[0]};