Commit 2295ba2e authored by Bill Pemberton's avatar Bill Pemberton Committed by Greg Kroah-Hartman

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: default avatarBill Pemberton <wfp5p@virginia.edu>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 3d3b5518
...@@ -218,8 +218,8 @@ void blkvsc_drv_exit(void) ...@@ -218,8 +218,8 @@ void blkvsc_drv_exit(void)
{ {
STORVSC_DRIVER_OBJECT *storvsc_drv_obj=&g_blkvsc_drv.drv_obj; STORVSC_DRIVER_OBJECT *storvsc_drv_obj=&g_blkvsc_drv.drv_obj;
struct driver_context *drv_ctx=&g_blkvsc_drv.drv_ctx; struct driver_context *drv_ctx=&g_blkvsc_drv.drv_ctx;
struct device *current_dev=NULL; struct device *current_dev=NULL;
int ret;
DPRINT_ENTER(BLKVSC_DRV); DPRINT_ENTER(BLKVSC_DRV);
...@@ -228,7 +228,14 @@ void blkvsc_drv_exit(void) ...@@ -228,7 +228,14 @@ void blkvsc_drv_exit(void)
current_dev = NULL; current_dev = NULL;
/* Get the device */ /* 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) if (current_dev == NULL)
break; break;
......
...@@ -638,8 +638,8 @@ void netvsc_drv_exit(void) ...@@ -638,8 +638,8 @@ void netvsc_drv_exit(void)
{ {
NETVSC_DRIVER_OBJECT *netvsc_drv_obj=&g_netvsc_drv.drv_obj; NETVSC_DRIVER_OBJECT *netvsc_drv_obj=&g_netvsc_drv.drv_obj;
struct driver_context *drv_ctx=&g_netvsc_drv.drv_ctx; struct driver_context *drv_ctx=&g_netvsc_drv.drv_ctx;
struct device *current_dev=NULL; struct device *current_dev=NULL;
int ret;
DPRINT_ENTER(NETVSC_DRV); DPRINT_ENTER(NETVSC_DRV);
...@@ -648,7 +648,14 @@ void netvsc_drv_exit(void) ...@@ -648,7 +648,14 @@ void netvsc_drv_exit(void)
current_dev = NULL; current_dev = NULL;
/* Get the device */ /* 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) if (current_dev == NULL)
break; break;
......
...@@ -188,8 +188,8 @@ void storvsc_drv_exit(void) ...@@ -188,8 +188,8 @@ void storvsc_drv_exit(void)
{ {
STORVSC_DRIVER_OBJECT *storvsc_drv_obj=&g_storvsc_drv.drv_obj; STORVSC_DRIVER_OBJECT *storvsc_drv_obj=&g_storvsc_drv.drv_obj;
struct driver_context *drv_ctx=&g_storvsc_drv.drv_ctx; struct driver_context *drv_ctx=&g_storvsc_drv.drv_ctx;
struct device *current_dev=NULL; struct device *current_dev=NULL;
int ret;
DPRINT_ENTER(STORVSC_DRV); DPRINT_ENTER(STORVSC_DRV);
...@@ -198,7 +198,13 @@ void storvsc_drv_exit(void) ...@@ -198,7 +198,13 @@ void storvsc_drv_exit(void)
current_dev = NULL; current_dev = NULL;
/* Get the device */ /* 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) if (current_dev == NULL)
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment