Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp462559ybl; Tue, 28 Jan 2020 06:21:14 -0800 (PST) X-Google-Smtp-Source: APXvYqwMYSrDIeaZfvaoyYt9/JiZg2tYVp+GfsXXguTYZrmx4CEFwOQBTyiVDlVAcrelZLhw5n2f X-Received: by 2002:aca:4b0f:: with SMTP id y15mr2844515oia.153.1580221274518; Tue, 28 Jan 2020 06:21:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580221274; cv=none; d=google.com; s=arc-20160816; b=KNbG5Bwf0gF12RM/lasx0PYI6vg2GynpBcSVUghLs+wBN9kkEAi8674DJnJr53R5sn Wzq87set1Da6iAd6iUo5MG/aCCunvS90aCxrFMonSsatH725ycHsC3SA4CRUWpS1eEfb qgS/C41omVHtWqyGeBPx01IZfBJfCqlUR/gKpBrYwXCQaLaJL8uoa+UZSKQBtx26MfqF vatr4e7/mvEXS5hHtiSIZ3Vcjlm1LYcJ9udRYrm2gZ9IaPs3WF5AhPLgij/n6cDDOqsr cSo8tpFSxzFBiuhQUFa7Pcmq7AIbmw4uUTEehfMyGytTfBVwVWzGHh3CM566yFmR3poP ycUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=L67ShNS1C+4PuhxOo/1egbfrb1rmZYY7q/xE2QYzfS4=; b=w0Nd4op2f75Q5vz1RlojNpedg5ICQ6OqmukzHyM48ySTNx+8NOKoLJPubi17ydL4+L s2Gg9lZOFIgVw+CYoIbmSdNmJjGblH1G6QV5Zj+oGUUm4lM+jU1tcegA3AF8s4vll4B4 eGXukcEot2IxeQKsXOh4rko3OUJjUSOLm4btQFIw6BE74+E43T4hlCqdGLDLt4D9qOUY cjT+c4riFegJDBNv95D3QNxR4Y6jn5zCFvURmu6qX7+V6Ma7N07a+vKXkqrGT7sNqp8z ZX4TWoaOqGjJVdnF9qEldJ2VF532s1MpN9ild+dVAaT7ZstQfkmljwHnQA/qH2xMCQwS 7OwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qDZDVz19; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f14si9471684otf.178.2020.01.28.06.21.02; Tue, 28 Jan 2020 06:21:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qDZDVz19; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730830AbgA1OTK (ORCPT + 99 others); Tue, 28 Jan 2020 09:19:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:43378 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730795AbgA1OTH (ORCPT ); Tue, 28 Jan 2020 09:19:07 -0500 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 B091421739; Tue, 28 Jan 2020 14:19:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580221147; bh=ew8TtFAbGh0YDWog97CRPrqFZI6pcvWQx7snqRfgzCA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qDZDVz19ulTXIiQjsw7HQ1nCjcXc0Osg6ahc9WLH03+ImbZW5UQLqGltxOBcASRaO METQo1WyhmaHzFXYZ3RJB+b8OXgD0sBYq3JdKINzcNV36ozem/T9gd2rOXP2SA1le0 OT1UPqMBqEINgIqNVuEZgWI/JB77hvoYy/Ema5tg= 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.9 106/271] ARM: OMAP2+: Fix potentially uninitialized return value for _setup_reset() Date: Tue, 28 Jan 2020 15:04:15 +0100 Message-Id: <20200128135900.475700264@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135852.449088278@linuxfoundation.org> References: <20200128135852.449088278@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 bfc74954540ce..9421b78f869d3 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -2588,7 +2588,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