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,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 646CDC43381 for ; Fri, 22 Mar 2019 11:36:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2EC262082C for ; Fri, 22 Mar 2019 11:36:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553254567; bh=NDRW8a4eLQytd5EB9pjAdhRmmcF5h45ICkL7tH89674=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=S+XICcjgVc/mld9jHt0VD/P9XD2eG3S/UCuTYD9Mw2DoOEHFKJmxujEeE3ReBC5+e W8WB3A9lvfjGcOmsuyh2j5FpigHFpoZqD/9MBbLEo0+ECP2gQXrxk3rM9yrYdtmKTI dLP/kmgvnCMouAUxH94p9p5Jg5xcR5ucZE0SVcXk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730647AbfCVLgF (ORCPT ); Fri, 22 Mar 2019 07:36:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:37246 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730632AbfCVLgC (ORCPT ); Fri, 22 Mar 2019 07:36:02 -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 003172082C; Fri, 22 Mar 2019 11:36:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553254561; bh=NDRW8a4eLQytd5EB9pjAdhRmmcF5h45ICkL7tH89674=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VZLI4e+GnMEBsCTSJjYCkQh4UEvU9HPO9DxM1g7Uocm6lvfq6yQtDOxMPthB0Tvfo t8ZvSDa+K/EFfMw89CKaa03+sJBeVqVD2wywHspbJj4gTuimjVKwiWbZHrXClt92UX 1C9PnBwSD4n5F6h9gwmGMgyD4fpHvxjHUeQufZSY= 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.4 159/230] ARM: OMAP2+: Variable "reg" in function omap4_dsi_mux_pads() could be uninitialized Date: Fri, 22 Mar 2019 12:14:57 +0100 Message-Id: <20190322111247.886568789@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190322111236.796964179@linuxfoundation.org> References: <20190322111236.796964179@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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-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 6ab13d18c636..cde86d1199cf 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c @@ -115,6 +115,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; @@ -130,7 +131,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