diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-06-12 14:04:33 +0200 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2018-06-13 01:19:22 +0200 |
commit | 8958fd411ba08aa3ac1aeb19828abaf9cf33f7b8 (patch) | |
tree | abfa2ce8dcf0673866e1236b4ef59f42eb8e2f9b /lib/test_overflow.c | |
parent | Merge tag 'f2fs-for-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/ja... (diff) | |
download | linux-8958fd411ba08aa3ac1aeb19828abaf9cf33f7b8.tar.xz linux-8958fd411ba08aa3ac1aeb19828abaf9cf33f7b8.zip |
test_overflow: fix an IS_ERR() vs NULL bug
root_device_register() returns error pointers, it never returns NULL.
Fixes: ca90800a91ba ("test_overflow: Add memory allocation overflow tests")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to '')
-rw-r--r-- | lib/test_overflow.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/test_overflow.c b/lib/test_overflow.c index aecbbb217305..2278fe05a1b0 100644 --- a/lib/test_overflow.c +++ b/lib/test_overflow.c @@ -367,7 +367,7 @@ static int __init test_overflow_allocation(void) /* Create dummy device for devm_kmalloc()-family tests. */ dev = root_device_register(device_name); - if (!dev) { + if (IS_ERR(dev)) { pr_warn("Cannot register test device\n"); return 1; } |