All of lore.kernel.org
 help / color / mirror / Atom feed
From: ebru.akagunduz@gmail.com (Ebru Akagunduz)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] mm: avoid uninitialized variable in tracepoint
Date: Tue, 19 Jan 2016 00:18:40 +0200	[thread overview]
Message-ID: <20160118221839.GA5787@debian> (raw)
In-Reply-To: <4117363.Ys1FTDH7Wz@wuerfel>

On Mon, Jan 18, 2016 at 09:50:26PM +0100, Arnd Bergmann wrote:
> 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 <arnd@arndb.de>
> Fixes: 7d2eba0557c1 ("mm: add tracepoint for scanning pages")
Reviewed-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
> 
> 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 */
> 

WARNING: multiple messages have this Message-ID (diff)
From: Ebru Akagunduz <ebru.akagunduz@gmail.com>
To: arnd@arndb.de, dan.carpenter@oracle.com, linux-mm@kvack.org
Cc: akpm@linux-foundation.org, torvalds@linux-foundation.org,
	kirill.shutemov@linux.intel.com, riel@redhat.com,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] mm: avoid uninitialized variable in tracepoint
Date: Tue, 19 Jan 2016 00:18:40 +0200	[thread overview]
Message-ID: <20160118221839.GA5787@debian> (raw)
In-Reply-To: <4117363.Ys1FTDH7Wz@wuerfel>

On Mon, Jan 18, 2016 at 09:50:26PM +0100, Arnd Bergmann wrote:
> 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 <arnd@arndb.de>
> Fixes: 7d2eba0557c1 ("mm: add tracepoint for scanning pages")
Reviewed-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
> 
> 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 */
> 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Ebru Akagunduz <ebru.akagunduz@gmail.com>
To: arnd@arndb.de, dan.carpenter@oracle.com, linux-mm@kvack.org
Cc: akpm@linux-foundation.org, torvalds@linux-foundation.org,
	kirill.shutemov@linux.intel.com, riel@redhat.com,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] mm: avoid uninitialized variable in tracepoint
Date: Tue, 19 Jan 2016 00:18:40 +0200	[thread overview]
Message-ID: <20160118221839.GA5787@debian> (raw)
In-Reply-To: <4117363.Ys1FTDH7Wz@wuerfel>

On Mon, Jan 18, 2016 at 09:50:26PM +0100, Arnd Bergmann wrote:
> 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 <arnd@arndb.de>
> Fixes: 7d2eba0557c1 ("mm: add tracepoint for scanning pages")
Reviewed-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
> 
> 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 */
> 

  reply	other threads:[~2016-01-18 22:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-18 20:50 [PATCH] mm: avoid uninitialized variable in tracepoint Arnd Bergmann
2016-01-18 20:50 ` Arnd Bergmann
2016-01-18 20:50 ` Arnd Bergmann
2016-01-18 22:18 ` Ebru Akagunduz [this message]
2016-01-18 22:18   ` Ebru Akagunduz
2016-01-18 22:18   ` Ebru Akagunduz
2016-01-18 23:03 ` Kirill A. Shutemov
2016-01-18 23:03   ` Kirill A. Shutemov
2016-01-18 23:03   ` Kirill A. Shutemov
2016-01-19 22:17   ` David Rientjes
2016-01-19 22:17     ` David Rientjes
2016-01-19 22:17     ` David Rientjes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160118221839.GA5787@debian \
    --to=ebru.akagunduz@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.