From: Bill Pemberton Date: Wed, 5 May 2010 19:27:38 +0000 (-0400) Subject: Staging: hv: remove ASSERT() in Channel.c X-Git-Tag: MMI-PSA29.97-13-9~23841^2^2~169 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c827f944f51e02894d68f036da843783e622ec2a;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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: Bill Pemberton Cc: Hank Janssen Cc: Haiyang Zhang Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/hv/Channel.c b/drivers/staging/hv/Channel.c index fdd441174f23..bd1a33608fcf 100644 --- a/drivers/staging/hv/Channel.c +++ b/drivers/staging/hv/Channel.c @@ -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);