提交 c827f944 编写于 作者: B Bill Pemberton 提交者: Greg Kroah-Hartman

Staging: hv: remove ASSERT() in Channel.c

VmbusChannelOpen() will now return -EINVAL if UserDataLen is too big.
Previously this was handled by an assert.
Signed-off-by: NBill Pemberton <wfp5p@virginia.edu>
Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 b94ef345
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册