From patchwork Thu Aug 20 05:26:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Furquan Shaikh X-Patchwork-Id: 11725703 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A048A14F6 for ; Thu, 20 Aug 2020 07:16:12 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7EDCC2078B for ; Thu, 20 Aug 2020 07:16:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="mOlrm/yp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7EDCC2078B Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AA12A6E8EB; Thu, 20 Aug 2020 07:14:54 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x649.google.com (mail-pl1-x649.google.com [IPv6:2607:f8b0:4864:20::649]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8699C6E8A6 for ; Thu, 20 Aug 2020 05:26:04 +0000 (UTC) Received: by mail-pl1-x649.google.com with SMTP id t7so848393plr.19 for ; Wed, 19 Aug 2020 22:26:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:message-id:mime-version:subject:from:to:cc; bh=lsbX1Xry7gppehECQgaCRYNE8or1PEFLIhmR1NXSOR0=; b=mOlrm/ypAWHV53bMT3Ty7Jh+auz977mwz7G2JytM7UUrOhtUX/Gx554bonVEsH8D+X n7EsfeRFgRsTd7fqJ6DGZi/OA2wlnW+LGGsLaN0fj/gFqnY4CqsjHgJZN0iyWBMDu/3a /xfrlcz6YiHxaw8TVMZZP/MvtrqfyIGOhLCn3vmSki/qgPs91Eu8Es6nLqhme6jpNHVw 5uHNPVl9bAmg0ooISIwvdf3XtWpBlCW9V9DM/nAGGpxbjm1QAk6yFcTTjWax49GTa+60 +hvFa0oTQm2qStaSIEAe+eq+HOvyDpzQ0vjxnwL3Ou49EV0FWnS4N8bE3PoIvOSOmi8o YgzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:message-id:mime-version:subject:from :to:cc; bh=lsbX1Xry7gppehECQgaCRYNE8or1PEFLIhmR1NXSOR0=; b=iDFWVeYoXmSc5vDqiRzL6Q6kKdGCibFaQkzUDWlH/n2nhnpgkSfeG63uXInoPDNZEL +SwwfVi8qQez1SnfMNsqWXTY9LerlUj3GCoDFj7oMDaRg/Y+fs4qeAx1C4eT8eVB+4ct W0nqQbDc6014QtJUb+k9WSSxlVKn4aKuqDEX3Z4SDU4tCtJKLMM844wkcrzQg5+/NHsc azAWJG+Ak7VTORhEJ5ARszx866s53Vec+FrrGiGI859jgIxNJyb3/w69HphLVMoy+wxP NmtCZoYS4PQsdc+q4qSWeAqsRcPOB0VBhUtDg/HgNgjxjqB9iz7otpl8W30SHkujzmsz Umxg== X-Gm-Message-State: AOAM533UQUNswA2ErPavwKW6JpqqsU0xmgbhDFpMQ8vdZX76eYJl0Eux 0AabuJS2yVab2gVjjlQLMtEvWwoA8T1q X-Google-Smtp-Source: ABdhPJyih8WdgObyYBpQNCGv4zrgvvHc7FA9Luht98sh6VTtC3hEyRDd6ObmxGoUW4L6Dtpjj42SS2nGdSg1 X-Received: from furquan.mtv.corp.google.com ([2620:15c:202:1:7220:84ff:fe09:13a4]) (user=furquan job=sendgmr) by 2002:a62:aa05:: with SMTP id e5mr1051919pff.70.1597901163900; Wed, 19 Aug 2020 22:26:03 -0700 (PDT) Date: Wed, 19 Aug 2020 22:26:00 -0700 Message-Id: <20200820052600.3069895-1-furquan@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.28.0.297.g1956fa8f8d-goog Subject: [PATCH] drivers: gpu: amd: Initialize amdgpu_dm_backlight_caps object to 0 in amdgpu_dm_update_backlight_caps From: Furquan Shaikh To: Harry Wentland , Leo Li , Alex Deucher X-Mailman-Approved-At: Thu, 20 Aug 2020 07:14:47 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stylon Wang , deepak.sharma@amd.com, Furquan Shaikh , David Airlie , linux-kernel@vger.kernel.org, Roman Li , amd-gfx@lists.freedesktop.org, Nicholas Kazlauskas , dri-devel@lists.freedesktop.org, adurbin@google.com, Mikita Lipski , Bhawanpreet Lakha , =?utf-8?q?Christian_K=C3=B6n?= =?utf-8?q?ig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" In `amdgpu_dm_update_backlight_caps()`, there is a local `amdgpu_dm_backlight_caps` object that is filled in by `amdgpu_acpi_get_backlight_caps()`. However, this object is uninitialized before the call and hence the subsequent check for aux_support can fail since it is not initialized by `amdgpu_acpi_get_backlight_caps()` as well. This change initializes this local `amdgpu_dm_backlight_caps` object to 0. Signed-off-by: Furquan Shaikh Reviewed-by: Christian König --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index e4b33c67b634..725d8af634ee 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -2853,7 +2853,7 @@ static int amdgpu_dm_mode_config_init(struct amdgpu_device *adev) static void amdgpu_dm_update_backlight_caps(struct amdgpu_display_manager *dm) { #if defined(CONFIG_ACPI) - struct amdgpu_dm_backlight_caps caps; + struct amdgpu_dm_backlight_caps caps = { 0 }; if (dm->backlight_caps.caps_valid) return;