mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 01:10:04 +00:00
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
1 changed files with 7 additions and 1 deletions
|
@ -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 a new issue