staging: unisys: visorbus: check for err from dev_set_name
authorDavid Kershner <david.kershner@unisys.com>
Tue, 28 Mar 2017 13:34:50 +0000 (09:34 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Mar 2017 07:17:03 +0000 (09:17 +0200)
The function dev_set_name can return an error, don't just ignore it.

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 ce897a2a4b792180081f38121797cb68e80b4864..f5b637ccf1cd52ff376a3e437861366dc0d95df0 100644 (file)
@@ -642,8 +642,10 @@ create_visor_device(struct visor_device *dev)
         * (NOT bus instance).  That's why we need to include the bus
         * number within the name.
         */
-       dev_set_name(&dev->device, "vbus%u:dev%u",
-                    chipset_bus_no, chipset_dev_no);
+       err = dev_set_name(&dev->device, "vbus%u:dev%u",
+                          chipset_bus_no, chipset_dev_no);
+       if (err)
+               goto err_put;
 
        /*
         * device_add does this: