From: Noralf Trønnes Date: Thu, 26 Jan 2017 22:56:04 +0000 (+0100) Subject: drm: drm_minor_register(): Clean up debugfs on failure X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a67834f8bfa1e2f48bb27d07b9a552ba7c3af82a;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm: drm_minor_register(): Clean up debugfs on failure Call drm_debugfs_cleanup() in case drm_debugfs_init() fails to cover for failure in the drm_driver.debugfs_init callback. Signed-off-by: Noralf Trønnes Signed-off-by: Daniel Vetter Link: http://patchwork.freedesktop.org/patch/msgid/20170126225621.12314-3-noralf@tronnes.org --- diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 7e24103c47f1..18c1b2cbfcdb 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -221,7 +221,7 @@ static int drm_minor_register(struct drm_device *dev, unsigned int type) ret = drm_debugfs_init(minor, minor->index, drm_debugfs_root); if (ret) { DRM_ERROR("DRM: Failed to initialize /sys/kernel/debug/dri.\n"); - return ret; + goto err_debugfs; } ret = device_add(minor->kdev);