aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/tmem.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2012-09-11 14:18:26 +0200
committerJan Beulich <jbeulich@suse.com>2012-09-11 14:18:26 +0200
commit2a25240fb4cab47c14296066e2abf0ecedc86ffa (patch)
tree746873c8a131c6370cf031cdaf82e5743979dc3f /xen/common/tmem.c
parentbdd868c82cefa4517c1b5a5ae96231c3de80c703 (diff)
downloadxen-2a25240fb4cab47c14296066e2abf0ecedc86ffa.tar.gz
xen-2a25240fb4cab47c14296066e2abf0ecedc86ffa.tar.bz2
xen-2a25240fb4cab47c14296066e2abf0ecedc86ffa.zip
tmem: properly drop lock on error path in do_tmem_op()
Reported-by: Tim Deegan <tim@xen.org> Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Diffstat (limited to 'xen/common/tmem.c')
-rw-r--r--xen/common/tmem.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/xen/common/tmem.c b/xen/common/tmem.c
index 6385cd1fcb..164c91f411 100644
--- a/xen/common/tmem.c
+++ b/xen/common/tmem.c
@@ -2659,13 +2659,19 @@ EXPORT long do_tmem_op(tmem_cli_op_t uops)
if ( client != NULL && tmh_client_is_dying(client) )
{
rc = -ENODEV;
- goto out;
+ if ( tmh_lock_all )
+ goto out;
+ simple_error:
+ errored_tmem_ops++;
+ return rc;
}
if ( unlikely(tmh_get_tmemop_from_client(&op, uops) != 0) )
{
printk("tmem: can't get tmem struct from %s\n",client_str);
rc = -EFAULT;
+ if ( !tmh_lock_all )
+ goto simple_error;
goto out;
}