Skip to content

Commit

Permalink
Staging: hv: remove ASSERT() in Channel.c
Browse files Browse the repository at this point in the history
VmbusChannelOpen() will now return -EINVAL if UserDataLen is too big.
Previously this was handled by an 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>
  • Loading branch information
Bill Pemberton authored and Greg Kroah-Hartman committed May 11, 2010
1 parent b94ef34 commit c827f94
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/staging/hv/Channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,11 @@ int VmbusChannelOpen(struct vmbus_channel *NewChannel, u32 SendRingBufferSize,
PAGE_SHIFT;
openMsg->ServerContextAreaGpadlHandle = 0; /* TODO */

ASSERT(UserDataLen <= MAX_USER_DEFINED_BYTES);
if (UserDataLen > MAX_USER_DEFINED_BYTES) {
err = -EINVAL;
goto errorout;
}

if (UserDataLen)
memcpy(openMsg->UserData, UserData, UserDataLen);

Expand Down

0 comments on commit c827f94

Please sign in to comment.