Skip to content

Commit

Permalink
staging: hv: remove ASSERT()s and return -EINVAL in RingBuffer.c
Browse files Browse the repository at this point in the history
return -EINVAL instead of calling ASSERT() for these conditionals.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Bill Pemberton authored and Greg Kroah-Hartman committed May 11, 2010
1 parent 3324fb4 commit a16e148
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/staging/hv/RingBuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit a16e148

Please sign in to comment.