Received: by 10.223.176.5 with SMTP id f5csp2988695wra; Mon, 5 Feb 2018 13:40:22 -0800 (PST) X-Google-Smtp-Source: AH8x226HutarnrtcFQOWq36pvFfp40hw66tlmkoEUKznz8AZm0UKdZDMI8OZXKrXXgXQfyVAB8Ro X-Received: by 10.98.54.71 with SMTP id d68mr172429pfa.173.1517866821902; Mon, 05 Feb 2018 13:40:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517866821; cv=none; d=google.com; s=arc-20160816; b=qhqQlET5nxnCrxxOTyyi4jE9YkRtDYx7SCoTE7uJm89+75tVOVNI64NcRrcOybo4gj uYMohpygMN6fKFZQcDm7KoAI88TU7bEEVxc9B9mCUPGGZr0KH+t+HCZAssYnKOTQ2iBw mOx5/R4dilAuorHXBEhHOnfnRszwZtgeU0CQ4Q8JTNNTBwOu+DUMe0TRcszAbL0HPPc7 pcyumDhskvhr88zmVqVzcpRUipclxE1K+ifc+eu+F87A0MhuMWS3l3NRXzHBdAFPzZ3t 9Ofcmv9T2Dzr5OC9ICFh+1/agfd1WhlEQp855QTGaVXT9Ff8RI6e0aPCLozf0kNJd47W /MxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=NiZQtTKiVkOM/wjbYOHaF8j6IIX/3PnGN0RO6fDvZd0=; b=wiietMpzLn9DFY+Th01iXMYxNWX7VQvOZz79LwWhww8l2IkF3DMGy+cBr+CoMrMkYu WmGr1/z+4is0KBxyQr62Zh5w9kgRTTWJ4/DGp+mzPbPM633yNjSakkzRSPBhrlVAFvUa LTuFTRhNAgboXkk7l0iOHVqOl6/pwLGRWVjJAd6Sri2xWZIF6ZmBBE5wZ8xF5ifZccdq dOReMT41zLwac5FIsyEoYMuWzIXiDOBfOKK+ZUdD+PxafIKl3Ax76Whd8teSkeYagQYr G7C1wPK2HBwcGhHbH7/w5FBLbtVY+W4VoPnBVChWVmwmYjtN/T5uzHUy5kq+NavoQxoM w2Yg== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x1si304249pgc.316.2018.02.05.13.40.07; Mon, 05 Feb 2018 13:40:21 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752502AbeBEVjV (ORCPT + 99 others); Mon, 5 Feb 2018 16:39:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41900 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752060AbeBEVjN (ORCPT ); Mon, 5 Feb 2018 16:39:13 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 036745B2F6; Mon, 5 Feb 2018 21:39:13 +0000 (UTC) Received: from treble (ovpn-121-104.rdu2.redhat.com [10.10.121.104]) by smtp.corp.redhat.com (Postfix) with SMTP id B1F1F60462; Mon, 5 Feb 2018 21:39:11 +0000 (UTC) Date: Mon, 5 Feb 2018 15:39:11 -0600 From: Josh Poimboeuf To: Arnd Bergmann Cc: Ingo Molnar , Dave Hansen , Thomas Gleixner , Nicolas Pitre , Vlastimil Babka , Peter Zijlstra , Andy Lutomirski , "H. Peter Anvin" , bpetkov@suse.de, Linux Kernel Mailing List , Andi Kleen , linux-tip-commits@vger.kernel.org Subject: Re: [tip:x86/urgent] x86/dumpstack: Avoid uninitlized variable Message-ID: <20180205213911.2auyud6a3k2ng7jx@treble> References: <20180202145634.200291-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 05 Feb 2018 21:39:13 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 05, 2018 at 10:21:06PM +0100, Arnd Bergmann wrote: > On Fri, Feb 2, 2018 at 11:36 PM, tip-bot for Arnd Bergmann > wrote: > > Commit-ID: ebfc15019cfa72496c674ffcb0b8ef10790dcddc > > Gitweb: https://git.kernel.org/tip/ebfc15019cfa72496c674ffcb0b8ef10790dcddc > > Author: Arnd Bergmann > > AuthorDate: Fri, 2 Feb 2018 15:56:17 +0100 > > Committer: Thomas Gleixner > > CommitDate: Fri, 2 Feb 2018 23:33:50 +0100 > > > > x86/dumpstack: Avoid uninitlized variable > > > > In some configurations, 'partial' does not get initialized, as shown by > > this gcc-8 warning: > > > > arch/x86/kernel/dumpstack.c: In function 'show_trace_log_lvl': > > arch/x86/kernel/dumpstack.c:156:4: error: 'partial' may be used uninitialized in this function [-Werror=maybe-uninitialized] > > show_regs_if_on_stack(&stack_info, regs, partial); > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > > This initializes it to false, to get the previous behavior in this case. > > > > Fixes: a9cdbe72c4e8 ("x86/dumpstack: Fix partial register dumps") > > > I just noticed my annotation got lost when I sent the patch. I originally > meant to ask Josh to double-check whether it should be 'false' or 'true' > here, or if we maybe need a larger change. > > Josh, could you take a look? Unfortunately I did not really understand > your original commit, so I don't know what the safe choice is here > in those cases in which 'partial' is uninitialized. I think it doesn't matter, it seems to be a false positive warning. The 'partial' variable is only used when 'regs' is non-NULL, and 'regs' is only set in unwind_get_entry_regs() after 'partial' gets initialized. -- Josh