mirror of https://gitee.com/openkylin/linux.git
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: Xiongwei Song <sxwjean@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
47ac54e877
commit
fb02205a18
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue