From 6325749f2117c5f00ae73a811745a6002489bdce Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Wed, 15 Nov 2017 16:07:59 +0000 Subject: [PATCH] Avoid hypothetical crash if output->init fails Summary: con->setOutput and crtc->setOutput is called in Output::~Output so this is doing it twice redundantly. More importantly Output::~Output calls crtc->blank(), which means we need a valid CRTC object there. Test Plan: Compiles Reviewers: #plasma, graesslin Reviewed By: #plasma, graesslin Subscribers: bshah, plasma-devel, kwin, #kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D8779 --- plugins/platforms/drm/drm_backend.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/plugins/platforms/drm/drm_backend.cpp b/plugins/platforms/drm/drm_backend.cpp index c99eed3a4a..def953b709 100644 --- a/plugins/platforms/drm/drm_backend.cpp +++ b/plugins/platforms/drm/drm_backend.cpp @@ -455,8 +455,6 @@ void DrmBackend::updateOutputs() if (!output->init(connector.data())) { qCWarning(KWIN_DRM) << "Failed to create output for connector " << con->id(); - con->setOutput(nullptr); - crtc->setOutput(nullptr); delete output; continue; }