From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.bootlin.com ([62.4.15.54]:33522 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388313AbeGXOjp (ORCPT ); Tue, 24 Jul 2018 10:39:45 -0400 From: Boris Brezillon To: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org Cc: Gustavo Padovan , Sean Paul , Eric Anholt , Boris Brezillon , stable@vger.kernel.org Subject: [PATCH v2] drm/atomic: Initialize variables in drm_atomic_helper_async_check() to make gcc happy Date: Tue, 24 Jul 2018 15:33:00 +0200 Message-Id: <20180724133300.32023-1-boris.brezillon@bootlin.com> Sender: stable-owner@vger.kernel.org List-ID: drm_atomic_helper_async_check() declares the plane, old_plane_state and new_plane_state variables to iterate over all planes of the atomic state and make sure only one plane is enabled. Unfortunately gcc is not smart enough to figure out that the check on n_planes is enough to guarantee that plane, new_plane_state and old_plane_state are initialized. Explicitly initialize those variables to NULL to make gcc happy. Fixes: fef9df8b5945 ("drm/atomic: initial support for asynchronous plane update") Cc: Signed-off-by: Boris Brezillon Reviewed-by: Sean Paul --- Changes in v2: - Cc stable - Add Sean's R-b - Fix a typo in the commit message --- drivers/gpu/drm/drm_atomic_helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index f7ccfebd3ca8..80be74df7ba6 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -1538,8 +1538,9 @@ int drm_atomic_helper_async_check(struct drm_device *dev, { struct drm_crtc *crtc; struct drm_crtc_state *crtc_state; - struct drm_plane *plane; - struct drm_plane_state *old_plane_state, *new_plane_state; + struct drm_plane *plane = NULL; + struct drm_plane_state *old_plane_state = NULL; + struct drm_plane_state *new_plane_state = NULL; const struct drm_plane_helper_funcs *funcs; int i, n_planes = 0; -- 2.14.1