From: Bill Pemberton Date: Wed, 5 May 2010 19:27:50 +0000 (-0400) Subject: staging: hv: remove ASSERT()s and return -EINVAL in RingBuffer.c X-Git-Tag: MMI-PSA29.97-13-9~23841^2^2~157 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a16e1485c758c236915ac1956694d11bff5e5daa;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 --- 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);