summaryrefslogtreecommitdiff
path: root/drivers/xen/tmem.c
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2013-04-30 15:27:01 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-30 17:04:01 -0700
commitf42158fe6785dd366073c7fd00f159a65c631597 (patch)
treee57f6ac9b87ebce63e5f87a5a032bf7d77b04fe8 /drivers/xen/tmem.c
parent10a7a0771399a57a297fca9615450dbb3f88081a (diff)
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/xen/tmem.c')
-rw-r--r--drivers/xen/tmem.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/xen/tmem.c b/drivers/xen/tmem.c
index 8adde8e8428c..e3600be4e7fa 100644
--- a/drivers/xen/tmem.c
+++ b/drivers/xen/tmem.c
@@ -397,8 +397,11 @@ static int xen_tmem_init(void)
frontswap_register_ops(&tmem_frontswap_ops);
tmem_frontswap_poolid = -1;
- if (old_ops)
+ if (IS_ERR(old_ops) || old_ops) {
+ if (IS_ERR(old_ops))
+ return PTR_ERR(old_ops);
s = " (WARNING: frontswap_ops overridden)";
+ }
printk(KERN_INFO "frontswap enabled, RAM provided by "
"Xen Transcendent Memory%s\n", s);
}