From patchwork Mon Jan 18 20:50:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101159 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2208004lbb; Mon, 18 Jan 2016 12:51:14 -0800 (PST) X-Received: by 10.98.17.79 with SMTP id z76mr39447258pfi.16.1453150273994; Mon, 18 Jan 2016 12:51:13 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n83si41867926pfa.183.2016.01.18.12.51.13; Mon, 18 Jan 2016 12:51:13 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756648AbcARUvM (ORCPT + 29 others); Mon, 18 Jan 2016 15:51:12 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:60273 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756311AbcARUvI (ORCPT ); Mon, 18 Jan 2016 15:51:08 -0500 Received: from wuerfel.localnet ([134.3.118.24]) by mrelayeu.kundenserver.de (mreue001) with ESMTPSA (Nemesis) id 0MCDQW-1aU6Sc0P32-008r1c; Mon, 18 Jan 2016 21:50:30 +0100 From: Arnd Bergmann To: Ebru Akagunduz , dan.carpenter@oracle.com, linux-mm@kvack.org Cc: Andrew Morton , Linus Torvalds , "Kirill A. Shutemov" , Rik van Riel , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] mm: avoid uninitialized variable in tracepoint Date: Mon, 18 Jan 2016 21:50:26 +0100 Message-ID: <4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1+r9G2hEJ7+tCmxDVmy8wMwH7W+K3n7M2dMYdaTQdodE38Nsr5Eq4 v1TY2jR6XQ6oxCWT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A newly added tracepoint in the hugepage code uses a variable in the error handling that is not initialized at that point: include/trace/events/huge_memory.h:81:230: error: 'isolated' may be used uninitialized in this function [-Werror=maybe-uninitialized] The result is relatively harmless, as the trace data will in rare cases contain incorrect data. This works around the problem by adding an explicit initialization. Signed-off-by: Arnd Bergmann Fixes: 7d2eba0557c1 ("mm: add tracepoint for scanning pages") Reviewed-by: Ebru Akagunduz Acked-by: David Rientjes diff --git a/mm/huge_memory.c b/mm/huge_memory.c index b2db98136af9..bb3b763b1829 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -2320,7 +2320,7 @@ static void collapse_huge_page(struct mm_struct *mm, pgtable_t pgtable; struct page *new_page; spinlock_t *pmd_ptl, *pte_ptl; - int isolated, result = 0; + int isolated = 0, result = 0; unsigned long hstart, hend; struct mem_cgroup *memcg; unsigned long mmun_start; /* For mmu_notifiers */