From patchwork Sat Dec 9 11:46:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10103781 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2139660325 for ; Sat, 9 Dec 2017 18:23:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05D6329144 for ; Sat, 9 Dec 2017 18:23:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB57E2914C; Sat, 9 Dec 2017 18:23:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8392A29144 for ; Sat, 9 Dec 2017 18:23:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 571C96E009; Sat, 9 Dec 2017 18:23:06 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 23782 seconds by postgrey-1.35 at gabe; Sat, 09 Dec 2017 18:23:04 UTC Received: from aserp2120.oracle.com (aserp2120.oracle.com [141.146.126.78]) by gabe.freedesktop.org (Postfix) with ESMTPS id 031826E009 for ; Sat, 9 Dec 2017 18:23:04 +0000 (UTC) Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.21/8.16.0.21) with SMTP id vB9Bk3xp062388; Sat, 9 Dec 2017 11:46:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2017-10-26; bh=enASJUNuLgvOs3VdVKEOn//f4uAqJ8I71FnMgUIhG5E=; b=l6Dg6PgE44VOSOz/FlH20Yo47Q9xXkRT3ewdEPuThHUSy+YlmVYLBhQknWeeo7jqHPUx g/4TZLs5B7pMqExLuE44nrG0v0xJymQz0bIplATgRL1Ct31UeUYvxcf7z0N8jf813hVV TwYHauPJaQLuRRL/cQ4tyJVO6PESbxCF86M15fwpILHHow5PX+yAyuU5lyN5pBZTHHK1 Odl8v17VimJvMyiloEwScHMI92zljdmUMZo8oVW6TPBCPYehpm0L4rVCI17Tuks6W0RA brbBBa3+i2OO5oDUjnGftLDaZPRY9/Q61vv/j4qNYqldnx5oYuu7n5DZ3NKKr1PNTU/U cA== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2120.oracle.com with ESMTP id 2erf7qg01w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 09 Dec 2017 11:46:35 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id vB9BkWnU016687 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 9 Dec 2017 11:46:33 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id vB9BkV6V002515; Sat, 9 Dec 2017 11:46:31 GMT Received: from mwanda (/197.157.34.162) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 09 Dec 2017 03:46:30 -0800 Date: Sat, 9 Dec 2017 14:46:13 +0300 From: Dan Carpenter To: Liviu Dudau , Mihail Atanassov Subject: [PATCH] drm: mali-dp: Uninitialized variable in malidp_se_check_scaling() Message-ID: <20171209114612.yrdmsak5rhn4kheq@mwanda> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: NeoMutt/20170609 (1.8.3) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8739 signatures=668644 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=812 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1712090167 Cc: David Airlie , kernel-janitors@vger.kernel.org, Mali DP Maintainers , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP We use "mc" without initializing it if scaling is not necessary. Fixes: 28ce675b7474 ("drm: mali-dp: Add plane upscaling support") Signed-off-by: Dan Carpenter Reviewed-by: Mihail Atanassov diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c index 33c5ef96ced0..82f9eaa5ee33 100644 --- a/drivers/gpu/drm/arm/malidp_planes.c +++ b/drivers/gpu/drm/arm/malidp_planes.c @@ -148,6 +148,8 @@ static int malidp_se_check_scaling(struct malidp_plane *mp, if (!crtc_state) return -EINVAL; + mc = to_malidp_crtc_state(crtc_state); + clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, @@ -166,8 +168,6 @@ static int malidp_se_check_scaling(struct malidp_plane *mp, if (mp->layer->id & (DE_SMART | DE_GRAPHICS2)) return -EINVAL; - mc = to_malidp_crtc_state(crtc_state); - mc->scaled_planes_mask |= mp->layer->id; /* Defer scaling requirements calculation to the crtc check. */ return 0;