[Sound-open-firmware] [PATCH 1/2] comp: buffer: reject buffer size 0 requests.

Liam Girdwood liam.r.girdwood at linux.intel.com
Thu Sep 7 16:35:06 CEST 2017


Signed-off-by: Liam Girdwood <liam.r.girdwood at linux.intel.com>
---
 src/include/reef/audio/buffer.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/include/reef/audio/buffer.h b/src/include/reef/audio/buffer.h
index e708ee2..ea9bd9c 100644
--- a/src/include/reef/audio/buffer.h
+++ b/src/include/reef/audio/buffer.h
@@ -183,6 +183,8 @@ static inline int buffer_set_size(struct comp_buffer *buffer, uint32_t size)
 {
 	if (size > buffer->alloc_size)
 		return -ENOMEM;
+	if (size == 0)
+		return -EINVAL;
 
 	buffer->end_addr = buffer->addr + size;
 	buffer->size = size;
-- 
2.11.0



More information about the Sound-open-firmware mailing list