From: Bill Pemberton Date: Wed, 5 May 2010 19:27:47 +0000 (-0400) Subject: staging: hv: remove ASSERT()s in RndisFilter.c X-Git-Tag: MMI-PSA29.97-13-9~23841^2^2~160 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8a62d7168af111bb80d041e6ccf74987056c79d3;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git staging: hv: remove ASSERT()s in RndisFilter.c return -EINVAL instead of calling ASSERT() for these conditionals. Signed-off-by: Bill Pemberton Cc: Hank Janssen Cc: Haiyang Zhang Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/hv/RndisFilter.c b/drivers/staging/hv/RndisFilter.c index f0aacc0c84c9..597c972f22c2 100644 --- a/drivers/staging/hv/RndisFilter.c +++ b/drivers/staging/hv/RndisFilter.c @@ -391,7 +391,9 @@ static int RndisFilterOnReceive(struct hv_device *Device, DPRINT_ENTER(NETVSC); - ASSERT(netDevice); + if (!netDevice) + return -EINVAL; + /* Make sure the rndis device state is initialized */ if (!netDevice->Extension) { DPRINT_ERR(NETVSC, "got rndis message but no rndis device..." @@ -492,7 +494,8 @@ static int RndisFilterQueryDevice(struct rndis_device *Device, u32 Oid, DPRINT_ENTER(NETVSC); - ASSERT(Result); + if (!Result) + return -EINVAL; *ResultSize = 0; request = GetRndisRequest(Device, REMOTE_NDIS_QUERY_MSG, @@ -885,7 +888,9 @@ int RndisFilterOnOpen(struct hv_device *Device) DPRINT_ENTER(NETVSC); - ASSERT(netDevice); + if (!netDevice) + return -EINVAL; + ret = RndisFilterOpenDevice(netDevice->Extension); DPRINT_EXIT(NETVSC); @@ -900,7 +905,9 @@ int RndisFilterOnClose(struct hv_device *Device) DPRINT_ENTER(NETVSC); - ASSERT(netDevice); + if (!netDevice) + return -EINVAL; + ret = RndisFilterCloseDevice(netDevice->Extension); DPRINT_EXIT(NETVSC);