linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/kasan/kasan.h: Fix boolean checking issue for kasan_report_enabled()
@ 2016-05-02  5:36 chengang
  2016-05-02  8:26 ` Dmitry Vyukov
  2016-05-02 11:34 ` Alexander Potapenko
  0 siblings, 2 replies; 15+ messages in thread
From: chengang @ 2016-05-02  5:36 UTC (permalink / raw)
  To: akpm, aryabinin, glider, dvyukov
  Cc: kasan-dev, linux-kernel, linux-mm, Chen Gang, Chen Gang

From: Chen Gang <chengang@emindsoft.com.cn>

According to kasan_[dis|en]able_current() comments and the kasan_depth'
s initialization, if kasan_depth is zero, it means disable.

So need use "!!kasan_depth" instead of "!kasan_depth" for checking
enable.

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
 mm/kasan/kasan.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h
index 7da78a6..6464b8f 100644
--- a/mm/kasan/kasan.h
+++ b/mm/kasan/kasan.h
@@ -102,7 +102,7 @@ static inline const void *kasan_shadow_to_mem(const void *shadow_addr)
 
 static inline bool kasan_report_enabled(void)
 {
-	return !current->kasan_depth;
+	return !!current->kasan_depth;
 }
 
 void kasan_report(unsigned long addr, size_t size,
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2016-05-14  5:26 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-02  5:36 [PATCH] mm/kasan/kasan.h: Fix boolean checking issue for kasan_report_enabled() chengang
2016-05-02  8:26 ` Dmitry Vyukov
2016-05-02 11:11   ` Chen Gang
2016-05-02 11:21     ` Dmitry Vyukov
2016-05-02 12:27       ` Chen Gang
2016-05-02 12:42         ` Alexander Potapenko
2016-05-02 13:51           ` Chen Gang
2016-05-02 14:23             ` Alexander Potapenko
2016-05-02 15:13               ` Chen Gang
2016-05-02 15:35                 ` Alexander Potapenko
2016-05-02 16:23                   ` Chen Gang
2016-05-02 16:38                     ` Chen Gang
2016-05-14  3:30                       ` Chen Gang
2016-05-02 11:34 ` Alexander Potapenko
2016-05-02 12:09   ` Chen Gang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).