diff options
author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2013-04-30 22:27:01 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-01 00:04:01 (GMT) |
commit | f42158fe6785dd366073c7fd00f159a65c631597 (patch) | |
tree | e57f6ac9b87ebce63e5f87a5a032bf7d77b04fe8 /drivers/staging | |
parent | 10a7a0771399a57a297fca9615450dbb3f88081a (diff) | |
download | linux-f42158fe6785dd366073c7fd00f159a65c631597.tar.xz |
zcache/tmem: Better error checking on frontswap_register_ops return value.
In the past it either used to be NULL or the "older" backend. Now we
also return -Exx error codes.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Bob Liu <lliubbo@gmail.com>
Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Cc: Andor Daam <andor.daam@googlemail.com>
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: Florian Schmaus <fschmaus@gmail.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Stefan Hengelein <ilendir@googlemail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/zcache/zcache-main.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/staging/zcache/zcache-main.c b/drivers/staging/zcache/zcache-main.c index 6bd4ebb..118602f 100644 --- a/drivers/staging/zcache/zcache-main.c +++ b/drivers/staging/zcache/zcache-main.c @@ -1886,8 +1886,11 @@ static int __init zcache_init(void) namestr, frontswap_has_exclusive_gets, !disable_frontswap_ignore_nonactive); #endif - if (old_ops != NULL) + if (IS_ERR(old_ops) || old_ops) { + if (IS_ERR(old_ops)) + return PTR_RET(old_ops); pr_warn("%s: frontswap_ops overridden\n", namestr); + } } if (ramster_enabled) ramster_init(!disable_cleancache, !disable_frontswap, |