From a16e1485c758c236915ac1956694d11bff5e5daa Mon Sep 17 00:00:00 2001 From: Bill Pemberton Date: Wed, 5 May 2010 15:27:50 -0400 Subject: [PATCH] staging: hv: remove ASSERT()s and return -EINVAL in RingBuffer.c return -EINVAL instead of calling ASSERT() for these conditionals. Signed-off-by: Bill Pemberton Cc: Hank Janssen Cc: Haiyang Zhang Signed-off-by: Greg Kroah-Hartman --- drivers/staging/hv/RingBuffer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/hv/RingBuffer.c b/drivers/staging/hv/RingBuffer.c index 69f3ebae15a9..64f8d0f9e05c 100644 --- a/drivers/staging/hv/RingBuffer.c +++ b/drivers/staging/hv/RingBuffer.c @@ -490,7 +490,8 @@ int RingBufferRead(RING_BUFFER_INFO *InRingInfo, void *Buffer, u64 prevIndices = 0; unsigned long flags; - ASSERT(BufferLen > 0); + if (BufferLen <= 0) + return -EINVAL; spin_lock_irqsave(&InRingInfo->ring_lock, flags); -- 2.20.1