backend/drm: Fix uninitialized variable

This commit is contained in:
Scott Anderson 2018-12-09 22:55:53 +13:00
parent efdd4d6ea2
commit fec88770dd
1 changed files with 3 additions and 4 deletions

View File

@ -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;
}