drm_aux-dev: fix error handling in drm_dp_aux_dev_init()
authorAlexey Khoroshilov <[email protected]>
Wed, 29 Jun 2016 21:52:15 +0000 (00:52 +0300)
committerDaniel Vetter <[email protected]>
Tue, 12 Jul 2016 12:10:57 +0000 (14:10 +0200)
If class_create() fails, there is no need for class_destroy().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
drivers/gpu/drm/drm_dp_aux_dev.c

index 3334baacf43d8d98d15546f9bb7019348cc6a2fb..734f86a345f628edab95c7ab3c8652a4d9927e7b 100644 (file)
@@ -355,8 +355,7 @@ int drm_dp_aux_dev_init(void)
 
        drm_dp_aux_dev_class = class_create(THIS_MODULE, "drm_dp_aux_dev");
        if (IS_ERR(drm_dp_aux_dev_class)) {
-               res = PTR_ERR(drm_dp_aux_dev_class);
-               goto out;
+               return PTR_ERR(drm_dp_aux_dev_class);
        }
        drm_dp_aux_dev_class->dev_groups = drm_dp_aux_groups;