drm: properly access a scoped pointer
Differential Revision: https://phabricator.kde.org/D28680
This commit is contained in:
parent
16fe8dbd88
commit
6a33533816
1 changed files with 4 additions and 5 deletions
|
@ -321,17 +321,16 @@ void DrmBackend::openDrm()
|
|||
}
|
||||
|
||||
DrmScopedPointer<drmModeRes> resources(drmModeGetResources(m_fd));
|
||||
drmModeRes *res = resources.data();
|
||||
if (!resources) {
|
||||
qCWarning(KWIN_DRM) << "drmModeGetResources failed";
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < res->count_connectors; ++i) {
|
||||
m_connectors << new DrmConnector(res->connectors[i], m_fd);
|
||||
for (int i = 0; i < resources->count_connectors; ++i) {
|
||||
m_connectors << new DrmConnector(resources->connectors[i], m_fd);
|
||||
}
|
||||
for (int i = 0; i < res->count_crtcs; ++i) {
|
||||
m_crtcs << new DrmCrtc(res->crtcs[i], this, i);
|
||||
for (int i = 0; i < resources->count_crtcs; ++i) {
|
||||
m_crtcs << new DrmCrtc(resources->crtcs[i], this, i);
|
||||
}
|
||||
|
||||
if (m_atomicModeSetting) {
|
||||
|
|
Loading…
Reference in a new issue