OSDN Git Service

minigbm: fix uninitialized variable error
authorLudovico de Nittis <ludovico.denittis@collabora.com>
Wed, 29 May 2019 08:02:21 +0000 (10:02 +0200)
committerchrome-bot <chrome-bot@chromium.org>
Wed, 12 Jun 2019 22:56:42 +0000 (15:56 -0700)
To fix the maybe uninitialized error we assign plane_type a starting
value.
The number zero corresponds to DRM_PLANE_TYPE_OVERLAY, so instead we
initialize plane_type to UINT64_MAX.

Bug: chromium:968030
Change-Id: I4fe119c1491926227151742041a73207971f56f0
Reviewed-on: https://chromium-review.googlesource.com/1634771
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
helpers.c

index 05ca9eb..66e7e78 100644 (file)
--- a/helpers.c
+++ b/helpers.c
@@ -558,6 +558,7 @@ struct drv_array *drv_query_kms(struct driver *drv)
                goto out;
 
        for (i = 0; i < resources->count_planes; i++) {
+               plane_type = UINT64_MAX;
                plane = drmModeGetPlane(drv->fd, resources->planes[i]);
                if (!plane)
                        goto out;