From patchwork Wed Oct 19 08:24:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5102 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp250224wrs; Wed, 19 Oct 2022 03:48:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Bg8SCLD1ptc26TJYMXPD1phpnb9eBTiJHbOiJbN+XT6R2YDsg43zflMNgrgTsllIRZg0W X-Received: by 2002:a17:907:daa:b0:78d:9bc9:7d7a with SMTP id go42-20020a1709070daa00b0078d9bc97d7amr6098638ejc.567.1666176508304; Wed, 19 Oct 2022 03:48:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666176508; cv=none; d=google.com; s=arc-20160816; b=v4gBF6ukqJEM4Wt/piGaHZaE93G6UN6EjNBa6eQfvFk55sLazMIiM869IuQYaar8Ua d6rgjEG6B9IPYrvZ5aOjcSKNKIik10LCBMxrZogoxKzkFFQLxNycmTXko52cinU9QtTP AZssrNk24OgIw235Nj9TrtiOQMHiOmmrjFCKgmbwScDYb3Lb8+ylUjsXK7GMJgpd1Hs7 gVa8MxvzkHs/Ty2CTobeY9dnUhUn+jCX1GJ34HcQf6TKEzJH3peqf3Kz2rK3QbmUsbDx PmwhgMKupQkUHFFV8/PB65z6lzwlcwBXr8zdBy9REOQwH5BNLrYcM8O5adqq5WNHjlka p3PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jS0caWKJfk5SgjSZGH7G12xNdENkopcRxQRXUqnrhk8=; b=nE7vNl/IhVkxRTid3cvN3chpnMdnnNKYmpsanDYiBvjiy3FelnOLL7XeCo4l9k88uo JJXazuqDH4kZjlblcfqyzDjXZDuyKoyB1JW4tGJDr6bTBFtFIRc8f/FYs3nY9YRq3UVY 742kqI7WEjPbl05Pz1Z9o/WSJUQWSkXCpFrpTtntHgxOywjNGMF/vnJkMuZ2BoYofjRr jdSZJaGaN2Oxfg/rPFlha8O54xl8MtP0Di/OoAILIzzbrJrnYz79CASpa/zqLqFVfvRB Xhfh5kad0McfyvGYU1F+0NQdZdUdmzZmIdE70aMZBD0+fUDKgoG9RAKwP2j8mcE5rxRA 0jyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=srQ8BDaR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jz18-20020a17090775f200b0078d00203ab4si10834530ejc.691.2022.10.19.03.48.03; Wed, 19 Oct 2022 03:48:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=srQ8BDaR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233794AbiJSKrn (ORCPT + 99 others); Wed, 19 Oct 2022 06:47:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232878AbiJSKp3 (ORCPT ); Wed, 19 Oct 2022 06:45:29 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6830F2252E; Wed, 19 Oct 2022 03:21:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 76969B822FF; Wed, 19 Oct 2022 08:47:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8F30C433C1; Wed, 19 Oct 2022 08:47:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169251; bh=WH12ROwbiwt2ezolUVlTl+7d90xLlvBmBnJiLhmIgiI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=srQ8BDaRqESqM+XbKeCcGLoK7XFBNhk43GVDDJohXUOpjP5VRqRAeS6ZqRYNstpR9 kJqY01LFUv2Cn9egX6bGWnxN1krUru7kDoIste+d9BHlHVYTZp5t3qZDC+GKmkuiEV JVBd2I/aSsuFIDpvFaLMMrOSx4zYjmtibMpC3//I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Wheeler , Rodrigo Siqueira , Qingqing Zhuo , Martin Leung , Alex Deucher Subject: [PATCH 6.0 192/862] drm/amd/display: zeromem mypipe heap struct before using it Date: Wed, 19 Oct 2022 10:24:39 +0200 Message-Id: <20221019083258.467322526@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747112698201104919?= X-GMAIL-MSGID: =?utf-8?q?1747112698201104919?= From: Martin Leung commit 5ff32b52995155f91de582124485d0f0f8881363 upstream. [Why & How] bug was caused when moving variable from stack to heap because it was reusable and garbage was left over, so we need to zero mem Fixes: 7acc487ab57e ("drm/amd/display: reduce stack size in dcn32 dml (v2)") Tested-by: Daniel Wheeler Reviewed-by: Rodrigo Siqueira Acked-by: Qingqing Zhuo Signed-off-by: Martin Leung Cc: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c @@ -733,6 +733,8 @@ static void DISPCLKDPPCLKDCFCLKDeepSleep mode_lib->vba.FCLKChangeLatency, v->UrgentLatency, mode_lib->vba.SREnterPlusExitTime); + memset(&v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.myPipe, 0, sizeof(DmlPipe)); + v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.myPipe.Dppclk = mode_lib->vba.DPPCLK[k]; v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.myPipe.Dispclk = mode_lib->vba.DISPCLK; v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.myPipe.PixelClock = mode_lib->vba.PixelClock[k];