]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
mm/vmpressure.c: fix a signedness bug in vmpressure_register_event()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 7 Oct 2019 00:58:28 +0000 (17:58 -0700)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 23 Oct 2019 13:04:30 +0000 (15:04 +0200)
commit295aee03b28528cad926f54aa0f36e7e05db91ed
tree01339ef976dea1a4657e4dc51e3970849013d5c7
parentb97cc0c53ccfbab737dbde67ef8e11148a49b39f
mm/vmpressure.c: fix a signedness bug in vmpressure_register_event()

BugLink: https://bugs.launchpad.net/bugs/1848750
commit 518a86713078168acd67cf50bc0b45d54b4cce6c upstream.

The "mode" and "level" variables are enums and in this context GCC will
treat them as unsigned ints so the error handling is never triggered.

I also removed the bogus initializer because it isn't required any more
and it's sort of confusing.

[akpm@linux-foundation.org: reduce implicit and explicit typecasting]
[akpm@linux-foundation.org: fix return value, add comment, per Matthew]
Link: http://lkml.kernel.org/r/20190925110449.GO3264@mwanda
Fixes: 3cadfa2b9497 ("mm/vmpressure.c: convert to use match_string() helper")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: David Rientjes <rientjes@google.com>
Reviewed-by: Matthew Wilcox <willy@infradead.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Enrico Weigelt <info@metux.net>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Connor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
mm/vmpressure.c