diff options
author | Bill Pemberton <wfp5p@virginia.edu> | 2010-05-05 15:27:39 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-11 11:36:13 -0700 |
commit | 002b53ea5713910daf215037b72c5820413e2f95 (patch) | |
tree | 566987e61ae07ed066a556d0229cca26fe28fcc9 | |
parent | c827f944f51e02894d68f036da843783e622ec2a (diff) | |
download | linux-3.10-002b53ea5713910daf215037b72c5820413e2f95.tar.gz linux-3.10-002b53ea5713910daf215037b72c5820413e2f95.tar.bz2 linux-3.10-002b53ea5713910daf215037b72c5820413e2f95.zip |
Staging: hv: return -EINVAL instead of calling ASSERT()
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>
-rw-r--r-- | drivers/staging/hv/Channel.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/staging/hv/Channel.c b/drivers/staging/hv/Channel.c index bd1a33608fc..0a9ca336ede 100644 --- a/drivers/staging/hv/Channel.c +++ b/drivers/staging/hv/Channel.c @@ -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); @@ -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 |