From patchwork Mon Nov 7 19:25:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 13035168 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 0D834C433FE for ; Mon, 7 Nov 2022 19:26:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9936210E392; Mon, 7 Nov 2022 19:26:06 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id 76E0110E37A for ; Mon, 7 Nov 2022 19:25:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667849156; x=1699385156; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=f9STN1h40wlSiMTp21PbvVzTvhlcNYbhKzH5LjJ8lww=; b=IjWoUwkhJepYoRViz3zE5tLqFXcdQgoJwpFGskenEhN+B75jw7VxH5i7 t4oo12sVWFBWcbiUwBy3GXUQNDXkj3199KERE3+9CrslxC311wRUEpPcl wFFBnU9oQtfOCfrhs8whHBz1cEryqqjS1jUFOSY2BU0SVadsFon7eEPHP ps+cCRpy2QgMk0l5MKpO2XwpkgUG5NSMG+Uf5LtmTTyn49dw3XX+rxYKe 744Frs1sjbJJrT0YxBePlgo55rm6aRp6byT4N4J+MhboGuDETJa9hsyvS QYY5P5y/Fot5IzkANpE9bzkMchYcv8q87X6f9Qgzd25tyFwf7AgphCycg w==; X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="308125566" X-IronPort-AV: E=Sophos;i="5.96,145,1665471600"; d="scan'208";a="308125566" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Nov 2022 11:25:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="705009769" X-IronPort-AV: E=Sophos;i="5.96,145,1665471600"; d="scan'208";a="705009769" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.191]) by fmsmga004.fm.intel.com with SMTP; 07 Nov 2022 11:25:53 -0800 Received: by stinkbox (sSMTP sendmail emulation); Mon, 07 Nov 2022 21:25:52 +0200 From: Ville Syrjala To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 2/7] drm/hisilicon: Use drm_mode_init() for on-stack modes Date: Mon, 7 Nov 2022 21:25:40 +0200 Message-Id: <20221107192545.9896-3-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20221107192545.9896-1-ville.syrjala@linux.intel.com> References: <20221107192545.9896-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 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: Xinliang Liu , Tian Tao , Xinwei Kong , John Stultz , Chen Feng Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Ville Syrjälä Initialize on-stack modes with drm_mode_init() to guarantee no stack garbage in the list head. Cc: Xinliang Liu Cc: Tian Tao Cc: John Stultz Cc: Xinwei Kong Cc: Chen Feng Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c index a0d5aa727d58..d9978b79828c 100644 --- a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c +++ b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c @@ -658,7 +658,7 @@ static enum drm_mode_status dsi_encoder_mode_valid(struct drm_encoder *encoder, * reset adj_mode to the mode value each time, * so we don't adjust the mode twice */ - drm_mode_copy(&adj_mode, mode); + drm_mode_init(&adj_mode, mode); crtc_funcs = crtc->helper_private; if (crtc_funcs && crtc_funcs->mode_fixup)