staging: unisys: visorbus: cleanup error handling in visorbus_uevent
authorDavid Kershner <david.kershner@unisys.com>
Tue, 28 Mar 2017 13:34:49 +0000 (09:34 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Mar 2017 07:17:03 +0000 (09:17 +0200)
The add_uevent_var returns an error. Don't overwrite the error with
-ENOMEM, just pass the error code back up.

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 f5e7dd6242f97b049d9eeefcd373646232c8a744..ce897a2a4b792180081f38121797cb68e80b4864 100644 (file)
@@ -82,9 +82,7 @@ visorbus_uevent(struct device *xdev, struct kobj_uevent_env *env)
        dev = to_visor_device(xdev);
        guid = visorchannel_get_uuid(dev->visorchannel);
 
-       if (add_uevent_var(env, "MODALIAS=visorbus:%pUl", &guid))
-               return -ENOMEM;
-       return 0;
+       return add_uevent_var(env, "MODALIAS=visorbus:%pUl", &guid);
 }
 
 /*