diff options
author | Scott Anderson <scott@anderso.nz> | 2018-12-09 22:55:53 +1300 |
---|---|---|
committer | Scott Anderson <scott@anderso.nz> | 2018-12-09 22:55:53 +1300 |
commit | fec88770dd1cbc42601b5cead8957dcb0b300fb0 (patch) | |
tree | 6fd401f9b7338a89337f47803cd4b8c185dc5db6 | |
parent | efdd4d6ea275ff4a0a22f8a348abca5847a9e65e (diff) |
backend/drm: Fix uninitialized variable
-rw-r--r-- | backend/drm/drm.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 14f1254f..0acb0324 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -993,11 +993,10 @@ static void realloc_crtcs(struct wlr_drm_backend *drm, bool *changed_outputs) { static uint32_t get_possible_crtcs(int fd, drmModeRes *res, drmModeConnector *conn, bool is_mst) { - drmModeEncoder *enc; uint32_t ret = 0; - for (int i = 0; !enc && i < conn->count_encoders; ++i) { - enc = drmModeGetEncoder(fd, conn->encoders[i]); + for (int i = 0; i < conn->count_encoders; ++i) { + drmModeEncoder *enc = drmModeGetEncoder(fd, conn->encoders[i]); if (!enc) { continue; } @@ -1016,7 +1015,7 @@ static uint32_t get_possible_crtcs(int fd, drmModeRes *res, } for (int i = 0; i < res->count_encoders; ++i) { - enc = drmModeGetEncoder(fd, res->encoders[i]); + drmModeEncoder *enc = drmModeGetEncoder(fd, res->encoders[i]); if (!enc) { continue; } |