Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1974409ybm; Thu, 23 May 2019 09:23:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqyFkUvIQYwN+3Mute2Ko9/yu3S/vqwZ9qmJ+PvVudLg9Sah43rdZ5oFK0mxBAApfDi23TAl X-Received: by 2002:a17:90a:2590:: with SMTP id k16mr2445834pje.11.1558628593041; Thu, 23 May 2019 09:23:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558628593; cv=none; d=google.com; s=arc-20160816; b=0PENjSlVS2hVcciXjFc0zgjguSANmZ1KPBYX3VM3/068/u69C4tMnFs+yUFkHVa1JZ boW8UcOOepNQX00sCXDHoQMgwCmPGePoqRhi3FmKocJUEHpLmn/CuxQVruqPUkDASzlR Op5in9//noReYI3Jt83oAvv2LWgu2Fg2sgYQ33LjNdNs3EuykjFbEbp1oCzxezFi4KWj Co5ylcj9+Xv14TBvXxGuith6eAtxCIGDoD2cSPShULkoyqqOwM8vexIyy9bINIFN6IyD F8Fc+bWn9GKKertXBhLibeGDPn5PjbAKFJVlRb1dlfNBI21IwzZoHm5PFyk2ISqefAcW iJzw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=H30dHdsxBPBoa8JLcL+g+keeJW2Oufbx6fLEMF7l9Mc=; b=D1WEgnpn4/kYNR/B9yZIVu3OJJMLi2OTm8GLlDvzgY5BTEf6M3MgFdxZoYHXxx/H7J dtO6eg2Q6uM0bU183H2+DC01AcjVowLmPyfPrjtTk3rrHVC1oYbaVWwLv00NyCuSZTU0 pMkJNG/aUDQsBBlwV31SrmbY+1CYbw+YRQw9WKS7C3AKjqEl33nikZLqjiO39Mi9+ezH eDxuiXFtypeQXXDRrFtz1bmuoBknIx7fxWEJ1u1/xD0Xl9Wx/MZow9jQNGCgLnoR1xW6 jnfq9Ffrgs5Gi5hYyvhvMSJiCU1jNE4lr6YTBxatVnuJ7W+Qfi5xQeaJgYLp/gNYNS6U YNYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Uk6PIHAf; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c32si1260065pje.0.2019.05.23.09.22.56; Thu, 23 May 2019 09:23:13 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=Uk6PIHAf; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731146AbfEWQUW (ORCPT + 99 others); Thu, 23 May 2019 12:20:22 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:38735 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730790AbfEWQUW (ORCPT ); Thu, 23 May 2019 12:20:22 -0400 Received: by mail-ed1-f68.google.com with SMTP id w11so10049368edl.5 for ; Thu, 23 May 2019 09:20:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=H30dHdsxBPBoa8JLcL+g+keeJW2Oufbx6fLEMF7l9Mc=; b=Uk6PIHAfcIBagXE3yQ+ZMAoIf7u/SwCgbE03WL5jxy3da5wnXxgvWADrv+ExRoIbyX JLGuGoKMS5x6s3a3LwWnEHneHUNXEmD1I9eeC5IILLqSHIPdH03C73xYSgf9H++xe5tQ C9OjbIHFtFzfFeICwpTjwpwbnaeq3q0S2nC+fxOpJNVHnHbnpyRE+eLzLRBmOl/7Ckq/ 8O4+hIDG5rYXHDB8DDfFrbiy5dlLSjXxwAMy4UnrVn8H8NymOzEZstkD5Mtl9qVzDEh4 ad30NWk40ncirgQKXsU/aBUczKEvVFM25KizoTbi/OlZcXqFkP1On4FnCetY9Et+q1E7 eANw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=H30dHdsxBPBoa8JLcL+g+keeJW2Oufbx6fLEMF7l9Mc=; b=O8ciGxNdGy2auYsuIhU3vLsNWzsxcloedpOg0GW5EJG6hxNsz/WueHOwTaApbGWZN4 SI+6xQ1CFAu1Fi4QcaDGpYrHLX89Q8Lsg7UY6hbrLFpCVZOFMYn9yIvrHuACNtgFTQQu rdol6D8gZrkJZ7AzI1ej4fkOjt8Wnhei8dCL5J9aGPlMVmlaZXxp0JN3ApBJAS3zpy/+ jWbLL/1LYRu7KZaQ1w64r6r0CiQegmdR5z/fR4uB7wPOZpNIwksh4iHiZ2KyruXzNFfb ibVJaL5tiRwmCr0ebZZUxZduqyUrHi9RX8+zJThaGGFxQhaQeExZS7A4c4ouXwZGFxu2 xkNQ== X-Gm-Message-State: APjAAAU0kS8155ma2LruVY54psYNZDhMtFwfazp+xIkVnmlh93rBcnYE MXIwIcw8VGmjtlN5047XFww= X-Received: by 2002:a50:94ed:: with SMTP id t42mr99222736eda.288.1558628420022; Thu, 23 May 2019 09:20:20 -0700 (PDT) Received: from localhost.localdomain ([2a01:4f9:2b:2b15::2]) by smtp.gmail.com with ESMTPSA id x40sm8018971edx.52.2019.05.23.09.20.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 May 2019 09:20:19 -0700 (PDT) From: Nathan Chancellor To: Cliff Whickman , Robin Holt Cc: Arnd Bergmann , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nick Desaulniers , Nathan Chancellor , Stephen Hines Subject: [PATCH] misc: sgi-xp: Properly initialize buf in xpc_get_rsvd_page_pa Date: Thu, 23 May 2019 09:15:33 -0700 Message-Id: <20190523161532.122421-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.22.0.rc1 In-Reply-To: References: MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clang warns: drivers/misc/sgi-xp/xpc_partition.c:73:14: warning: variable 'buf' is uninitialized when used within its own initialization [-Wuninitialized] void *buf = buf; ~~~ ^~~ 1 warning generated. Initialize it to NULL, which is more deterministic. Fixes: 279290294662 ("[IA64-SGI] cleanup the way XPC locates the reserved page") Link: https://github.com/ClangBuiltLinux/linux/issues/466 Suggested-by: Stephen Hines Signed-off-by: Nathan Chancellor --- Thanks Steve for the suggestion, don't know why that never crossed my mind... I tried to follow buf all the way down in get_partition_rsvd_page to see if there would be any dereferences and I didn't see any but I could have easily missed something. drivers/misc/sgi-xp/xpc_partition.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/sgi-xp/xpc_partition.c b/drivers/misc/sgi-xp/xpc_partition.c index 3eba1c420cc0..782ce95d3f17 100644 --- a/drivers/misc/sgi-xp/xpc_partition.c +++ b/drivers/misc/sgi-xp/xpc_partition.c @@ -70,7 +70,7 @@ xpc_get_rsvd_page_pa(int nasid) unsigned long rp_pa = nasid; /* seed with nasid */ size_t len = 0; size_t buf_len = 0; - void *buf = buf; + void *buf = NULL; void *buf_base = NULL; enum xp_retval (*get_partition_rsvd_page_pa) (void *, u64 *, unsigned long *, size_t *) = -- 2.22.0.rc1