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>
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 @@
{
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 @@
current_dev = NULL;
/* Get the device */
- driver_for_each_device(&drv_ctx->driver, NULL, (void*)¤t_dev, storvsc_drv_exit_cb);
+ ret = driver_for_each_device(&drv_ctx->driver, NULL,
+ (void *) ¤t_dev,
+ storvsc_drv_exit_cb);
+
+ if (ret)
+ DPRINT_WARN(STORVSC_DRV,
+ "driver_for_each_device returned %d", ret);
if (current_dev == NULL)
break;