[PATCH 417/577] staging: hv: remove ASSERT()s in RndisFilter.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Bill Pemberton <wfp5p@xxxxxxxxxxxx>

return -EINVAL instead of calling ASSERT() for these conditionals.

Signed-off-by: Bill Pemberton <wfp5p@xxxxxxxxxxxx>
Cc: Hank Janssen <hjanssen@xxxxxxxxxxxxx>
Cc: Haiyang Zhang <haiyangz@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
---
 drivers/staging/hv/RndisFilter.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/hv/RndisFilter.c b/drivers/staging/hv/RndisFilter.c
index f0aacc0..597c972 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);
-- 
1.7.0.3

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux