OSDN Git Service

staging: unisys: visorbus: add error handling for dev_start_periodic_work
authorDavid Kershner <david.kershner@unisys.com>
Tue, 28 Mar 2017 13:34:43 +0000 (09:34 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Mar 2017 07:17:03 +0000 (09:17 +0200)
Report errors if we have a problem in dev_start_periodic_work.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/unisys/visorbus/visorbus_main.c

index 6f3bbe5..c97f32f 100644 (file)
@@ -464,16 +464,17 @@ dev_periodic_work(unsigned long __opaque)
        mod_timer(&dev->timer, jiffies + POLLJIFFIES_NORMALCHANNEL);
 }
 
-static void
+static int
 dev_start_periodic_work(struct visor_device *dev)
 {
        if (dev->being_removed || dev->timer_active)
-               return;
+               return -EINVAL;
        /* now up by at least 2 */
        get_device(&dev->device);
        dev->timer.expires = jiffies + POLLJIFFIES_NORMALCHANNEL;
        add_timer(&dev->timer);
        dev->timer_active = true;
+       return 0;
 }
 
 static void