From: Jan Beulich Date: Tue, 11 Sep 2012 12:18:26 +0000 (+0200) Subject: tmem: properly drop lock on error path in do_tmem_op() X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~7947 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=2a25240fb4cab47c14296066e2abf0ecedc86ffa;p=xen.git tmem: properly drop lock on error path in do_tmem_op() Reported-by: Tim Deegan Signed-off-by: Jan Beulich Acked-by: Dan Magenheimer --- 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; }