Commit fb02205a authored by Xiongwei Song's avatar Xiongwei Song Committed by Greg Kroah-Hartman

staging: android: check the return value of register_shrinker

register_shrinker call is made in ashmem_init, it may return error code,
so we need to check it.
Signed-off-by: default avatarXiongwei Song <sxwjean@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 47ac54e8
......@@ -873,12 +873,18 @@ static int __init ashmem_init(void)
goto out_free2;
}
register_shrinker(&ashmem_shrinker);
ret = register_shrinker(&ashmem_shrinker);
if (ret) {
pr_err("failed to register shrinker!\n");
goto out_demisc;
}
pr_info("initialized\n");
return 0;
out_demisc:
misc_deregister(&ashmem_misc);
out_free2:
kmem_cache_destroy(ashmem_range_cachep);
out_free1:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment