From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2727C43381 for ; Fri, 22 Mar 2019 12:48:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A079A218E2 for ; Fri, 22 Mar 2019 12:48:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553258908; bh=r5Z2oEO6ozkaHmF9GdTjIEvGwsDsNshwXVj9C9girrM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=b4WehOKCAbqpElRQUSIp04XFmNt0yfRW3xjg7pwoRdOrlo48dShZTmY6EkkfSkR2l O5uMSOSkQvAIpO6SbagX4suhRjhPQnHz/9isnnEuiLpNpqB+ms9vbI6sIlVHajPxNe j4ZajmltagZlJCkIwgPG+JEdfxhE9+1l3qgJ37+k= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387455AbfCVL5j (ORCPT ); Fri, 22 Mar 2019 07:57:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:34126 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733240AbfCVL5f (ORCPT ); Fri, 22 Mar 2019 07:57:35 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B1C682192D; Fri, 22 Mar 2019 11:57:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553255855; bh=r5Z2oEO6ozkaHmF9GdTjIEvGwsDsNshwXVj9C9girrM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GTqLby2uZImTWUQmDHWm2aQnAwdwXjaQOD5r7CIp8rnieqBVPUSicgJbfXJFuJ6uQ UWeouUD12JmIkwXnoDvaKV6hd0vttp4xPPQ2JlTFVIV96Sy2SNvikM9DIUgvApZXRW GZIpwA2CJh43bDMe7jjxAcjLL7p81SKyeG1rpTTM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yizhuo , Tony Lindgren , Sasha Levin Subject: [PATCH 4.19 035/280] ARM: OMAP2+: Variable "reg" in function omap4_dsi_mux_pads() could be uninitialized Date: Fri, 22 Mar 2019 12:13:08 +0100 Message-Id: <20190322111308.288657403@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190322111306.356185024@linuxfoundation.org> References: <20190322111306.356185024@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit dc30e70391376ba3987aeb856ae6d9c0706534f1 ] In function omap4_dsi_mux_pads(), local variable "reg" could be uninitialized if function regmap_read() returns -EINVAL. However, it will be used directly in the later context, which is potentially unsafe. Signed-off-by: Yizhuo Signed-off-by: Tony Lindgren Signed-off-by: Sasha Levin --- arch/arm/mach-omap2/display.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c index 9500b6e27380..5d73f2c0b117 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c @@ -83,6 +83,7 @@ static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes) u32 enable_mask, enable_shift; u32 pipd_mask, pipd_shift; u32 reg; + int ret; if (dsi_id == 0) { enable_mask = OMAP4_DSI1_LANEENABLE_MASK; @@ -98,7 +99,11 @@ static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes) return -ENODEV; } - regmap_read(omap4_dsi_mux_syscon, OMAP4_DSIPHY_SYSCON_OFFSET, ®); + ret = regmap_read(omap4_dsi_mux_syscon, + OMAP4_DSIPHY_SYSCON_OFFSET, + ®); + if (ret) + return ret; reg &= ~enable_mask; reg &= ~pipd_mask; -- 2.19.1