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.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,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 08980C2D0DB for ; Fri, 24 Jan 2020 11:14:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C4B44214AF for ; Fri, 24 Jan 2020 11:14:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579864483; bh=iWr5OHqBCttoB7ViCKE9ZXcze2xhoY5hmOmMJQgLN4M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=JG2JPW/0RqQWxQinWz8BEsBhZERs1YM3U+tdrooUIyEh5Qn9APvBae05SdDI9hORl 02YElx/rbBsER9jpsC9mdrRidBa+ZhpFAzvLU4OPWN8RduA94mWUAd1BKL9wuzs/De osnZ9hfi46+PSTaaFbhWD4vzr7VtW3+CuBw8kNb8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390244AbgAXLOm (ORCPT ); Fri, 24 Jan 2020 06:14:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:51074 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390228AbgAXLOj (ORCPT ); Fri, 24 Jan 2020 06:14:39 -0500 Received: from localhost (ip-213-127-102-57.ip.prioritytelecom.net [213.127.102.57]) (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 6A0542075D; Fri, 24 Jan 2020 11:14:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579864479; bh=iWr5OHqBCttoB7ViCKE9ZXcze2xhoY5hmOmMJQgLN4M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XO+jOHNGGLq0QMWS5TnMulJBbLHqhoX+s67wWgPnX0Rp5wOuBsZPWDM1enLFRewKD 7kM9g6VPYEGSSqo1IAImsK4XV0Aq/RhQ3IUZYOMfgDg0kWMuwfp62f+wDop8zmkjit xbjmR2bhLbCNHfH/etGGuuV0Rt1PvLQmyGXQUano= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paul Walmsley , Tero Kristo , Tony Lindgren , Sasha Levin Subject: [PATCH 4.19 277/639] ARM: OMAP2+: Fix potentially uninitialized return value for _setup_reset() Date: Fri, 24 Jan 2020 10:27:27 +0100 Message-Id: <20200124093121.529725406@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200124093047.008739095@linuxfoundation.org> References: <20200124093047.008739095@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Tony Lindgren [ Upstream commit 7f0d078667a494466991aa7133f49594f32ff6a2 ] Commit 747834ab8347 ("ARM: OMAP2+: hwmod: revise hardreset behavior") made the call to _enable() conditional based on no oh->rst_lines_cnt. This caused the return value to be potentially uninitialized. Curiously we see no compiler warnings for this, probably as this gets inlined. We call _setup_reset() from _setup() and only _setup_postsetup() if the return value is zero. Currently the return value can be uninitialized for cases where oh->rst_lines_cnt is set and HWMOD_INIT_NO_RESET is not set. Fixes: 747834ab8347 ("ARM: OMAP2+: hwmod: revise hardreset behavior") Cc: Paul Walmsley Cc: Tero Kristo Signed-off-by: Tony Lindgren Signed-off-by: Sasha Levin --- arch/arm/mach-omap2/omap_hwmod.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index ec3789ba17b8b..a8269f0a87ced 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -2430,7 +2430,7 @@ static void _setup_iclk_autoidle(struct omap_hwmod *oh) */ static int _setup_reset(struct omap_hwmod *oh) { - int r; + int r = 0; if (oh->_state != _HWMOD_STATE_INITIALIZED) return -EINVAL; -- 2.20.1