From 790696847dfad8b2d968ce82cc1be58ebacefead Mon Sep 17 00:00:00 2001 From: Bill Pemberton Date: Wed, 5 May 2010 15:27:56 -0400 Subject: [PATCH 424/577] staging: hv: remove ASSERT() and return -EINVAL in NetVsc.c return -EINVAL instead of calling ASSERT() Signed-off-by: Bill Pemberton Cc: Hank Janssen Cc: Haiyang Zhang Signed-off-by: Greg Kroah-Hartman --- drivers/staging/hv/NetVsc.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/drivers/staging/hv/NetVsc.c b/drivers/staging/hv/NetVsc.c index ddde391..f852984 100644 --- a/drivers/staging/hv/NetVsc.c +++ b/drivers/staging/hv/NetVsc.c @@ -354,7 +354,11 @@ static int NetVscInitializeSendBufferWithNetVsp(struct hv_device *Device) DPRINT_EXIT(NETVSC); return -1; } - ASSERT(netDevice->SendBufferSize > 0); + if (netDevice->SendBufferSize <= 0) { + ret = -EINVAL; + goto Cleanup; + } + /* page-size grandularity */ /* ASSERT((netDevice->SendBufferSize & (PAGE_SIZE - 1)) == 0); */ -- 1.7.0.3