提交 8958fd41 编写于 作者: D Dan Carpenter 提交者: Kees Cook

test_overflow: fix an IS_ERR() vs NULL bug

root_device_register() returns error pointers, it never returns NULL.

Fixes: ca90800a ("test_overflow: Add memory allocation overflow tests")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NKees Cook <keescook@chromium.org>
上级 d54d35c5
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册