Skip to content

Commit

Permalink
Staging: hv: return -EINVAL instead of calling ASSERT()
Browse files Browse the repository at this point in the history
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 c827f94 commit 002b53e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/staging/hv/Channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,8 @@ int VmbusChannelSendPacketPageBuffer(struct vmbus_channel *Channel,

DPRINT_ENTER(VMBUS);

ASSERT(PageCount <= MAX_PAGE_BUFFER_COUNT);
if (PageCount > MAX_PAGE_BUFFER_COUNT)
return -EINVAL;

DumpVmbusChannel(Channel);

Expand Down Expand Up @@ -864,8 +865,8 @@ int VmbusChannelSendPacketMultiPageBuffer(struct vmbus_channel *Channel,
DPRINT_DBG(VMBUS, "data buffer - offset %u len %u pfn count %u",
MultiPageBuffer->Offset, MultiPageBuffer->Length, PfnCount);

ASSERT(PfnCount > 0);
ASSERT(PfnCount <= MAX_MULTIPAGE_BUFFER_COUNT);
if ((PfnCount < 0) || (PfnCount > MAX_MULTIPAGE_BUFFER_COUNT))
return -EINVAL;

/*
* Adjust the size down since VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER is
Expand Down

0 comments on commit 002b53e

Please sign in to comment.