summaryrefslogtreecommitdiffstats
path: root/drivers/staging/hv/netvsc_drv.c
diff options
context:
space:
mode:
authorBill Pemberton2009-07-28 19:46:22 +0200
committerGreg Kroah-Hartman2009-09-15 21:01:52 +0200
commit2295ba2e7c4141e864f66830b07e635245233a3d (patch)
tree171fce7ebd2a1a770b98b7825d0d31d5b76abccc /drivers/staging/hv/netvsc_drv.c
parentStaging: hv: Transform PDEVICE_OBJECT and DEVICE_OBJECT typedefs into their c... (diff)
downloadkernel-qcow2-linux-2295ba2e7c4141e864f66830b07e635245233a3d.tar.gz
kernel-qcow2-linux-2295ba2e7c4141e864f66830b07e635245233a3d.tar.xz
kernel-qcow2-linux-2295ba2e7c4141e864f66830b07e635245233a3d.zip
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>
Diffstat (limited to 'drivers/staging/hv/netvsc_drv.c')
-rw-r--r--drivers/staging/hv/netvsc_drv.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index f0df216028ad..9010f0e2ce68 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;