Commit 4f429283 authored by Noralf Trønnes's avatar Noralf Trønnes Committed by Thadeu Lima de Souza Cascardo

drm: drm_minor_register(): Clean up debugfs on failure

BugLink: http://bugs.launchpad.net/bugs/1732698

[ Upstream commit a67834f8 ]

Call drm_debugfs_cleanup() in case drm_debugfs_init() fails to
cover for failure in the drm_driver.debugfs_init callback.
Signed-off-by: default avatarNoralf Trønnes <noralf@tronnes.org>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20170126225621.12314-3-noralf@tronnes.orgSigned-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarThadeu Lima de Souza Cascardo <cascardo@canonical.com>
parent f29898c4
...@@ -312,7 +312,7 @@ static int drm_minor_register(struct drm_device *dev, unsigned int type) ...@@ -312,7 +312,7 @@ static int drm_minor_register(struct drm_device *dev, unsigned int type)
ret = drm_debugfs_init(minor, minor->index, drm_debugfs_root); ret = drm_debugfs_init(minor, minor->index, drm_debugfs_root);
if (ret) { if (ret) {
DRM_ERROR("DRM: Failed to initialize /sys/kernel/debug/dri.\n"); DRM_ERROR("DRM: Failed to initialize /sys/kernel/debug/dri.\n");
return ret; goto err_debugfs;
} }
ret = device_add(minor->kdev); ret = device_add(minor->kdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment