mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
test_overflow: fix an IS_ERR() vs NULL bug
root_device_register() returns error pointers, it never returns NULL.
Fixes: ca90800a91 ("test_overflow: Add memory allocation overflow tests")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
This commit is contained in:
1 parent
d54d35c501
commit
8958fd411b
1 file changed
+1
-1
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user