Staging: hv: check return value of driver_for_each_device()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Wednesday, September 16, 2009 - 9:06 am

Gitweb:     http://git.kernel.org/linus/2295ba2e7c4141e864f66830b07e635245233a3d
Commit:     2295ba2e7c4141e864f66830b07e635245233a3d
Parent:     3d3b5518a35fa3c31b74224d944cbc83302c5ab4
Author:     Bill Pemberton <wfp5p@virginia.edu>
AuthorDate: Tue Jul 28 13:46:22 2009 -0400
Committer:  Greg Kroah-Hartman <gregkh@suse.de>
CommitDate: Tue Sep 15 12:01:52 2009 -0700

    Staging: hv: check return value of driver_for_each_device()
    
    The return value of driver_for_each_device() is now checked.  A
    non-zero value simply generates a warning message, but it's better
    than not checking at all.
    
    Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
    Cc: Hank Janssen <hjanssen@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/staging/hv/blkvsc_drv.c  |   11 +++++++++--
 drivers/staging/hv/netvsc_drv.c  |   11 +++++++++--
 drivers/staging/hv/storvsc_drv.c |   10 ++++++++--
 3 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
index d595c3b..dff950b 100644
--- a/drivers/staging/hv/blkvsc_drv.c
+++ b/drivers/staging/hv/blkvsc_drv.c
@@ -218,8 +218,8 @@ void blkvsc_drv_exit(void)
 {
 	STORVSC_DRIVER_OBJECT *storvsc_drv_obj=&g_blkvsc_drv.drv_obj;
 	struct driver_context *drv_ctx=&g_blkvsc_drv.drv_ctx;
-
 	struct device *current_dev=NULL;
+	int ret;
 
 	DPRINT_ENTER(BLKVSC_DRV);
 
@@ -228,7 +228,14 @@ void blkvsc_drv_exit(void)
 		current_dev = NULL;
 
 		/* Get the device */
-		driver_for_each_device(&drv_ctx->driver, NULL, (void*)&current_dev, blkvsc_drv_exit_cb);
+		ret = driver_for_each_device(&drv_ctx->driver, NULL,
+					     (void *) &current_dev,
+					     blkvsc_drv_exit_cb);
+
+		if (ret)
+			DPRINT_WARN(BLKVSC_DRV,
+				    "driver_for_each_device returned %d", ret);
+
 
 		if (current_dev == NULL)
 			break;
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index f0df216..9010f0e 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -638,8 +638,8 @@ void netvsc_drv_exit(void)
 {
 	NETVSC_DRIVER_OBJECT *netvsc_drv_obj=&g_netvsc_drv.drv_obj;
 	struct driver_context *drv_ctx=&g_netvsc_drv.drv_ctx;
-
 	struct device *current_dev=NULL;
+	int ret;
 
 	DPRINT_ENTER(NETVSC_DRV);
 
@@ -648,7 +648,14 @@ void netvsc_drv_exit(void)
 		current_dev = NULL;
 
 		/* Get the device */
-		driver_for_each_device(&drv_ctx->driver, NULL, (void*)&current_dev, netvsc_drv_exit_cb);
+		ret = driver_for_each_device(&drv_ctx->driver, NULL,
+					     (void *) &current_dev,
+					     netvsc_drv_exit_cb);
+
+		if (ret)
+			DPRINT_WARN(NETVSC_DRV,
+				    "driver_for_each_device returned %d", ret);
+
 
 		if (current_dev == NULL)
 			break;
diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
index 385e84b..120ec52 100644
--- a/drivers/staging/hv/storvsc_drv.c
+++ b/drivers/staging/hv/storvsc_drv.c
@@ -188,8 +188,8 @@ void storvsc_drv_exit(void)
 {
 	STORVSC_DRIVER_OBJECT *storvsc_drv_obj=&g_storvsc_drv.drv_obj;
 	struct driver_context *drv_ctx=&g_storvsc_drv.drv_ctx;
-
 	struct device *current_dev=NULL;
+	int ret;
 
 	DPRINT_ENTER(STORVSC_DRV);
 
@@ -198,7 +198,13 @@ void storvsc_drv_exit(void)
 		current_dev = NULL;
 
 		/* Get the device */
-		driver_for_each_device(&drv_ctx->driver, NULL, (void*)&current_dev, storvsc_drv_exit_cb);
+		ret = driver_for_each_device(&drv_ctx->driver, NULL,
+					     (void *) &current_dev,
+					     storvsc_drv_exit_cb);
+
+		if (ret)
+			DPRINT_WARN(STORVSC_DRV,
+				    "driver_for_each_device returned %d", ret);
 
 		if (current_dev == NULL)
 			break;
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Staging: hv: check return value of driver_for_each_device(), Linux Kernel Mailing ..., (Wed Sep 16, 9:06 am)