diff options
author | Simon Gaiser <simon@invisiblethingslab.com> | 2018-03-14 22:43:21 -0400 |
---|---|---|
committer | Boris Ostrovsky <boris.ostrovsky@oracle.com> | 2018-03-21 08:28:51 -0400 |
commit | b93008d1ac657dc67819330c5995e65e7c3e7978 (patch) | |
tree | 8a0d21069d02bf3b250f0f5b2cd980c2062e31d5 | |
parent | 2a22ee6c3ab1d761bc9c04f1e4117edd55b82f09 (diff) |
xen: xenbus: Catch closing of non existent transactions
Users of the xenbus functions should never close a non existent
transaction (for example by trying to closing the same transaction
twice) but better catch it in xs_request_exit() than to corrupt the
reference counter.
Signed-off-by: Simon Gaiser <simon@invisiblethingslab.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
-rw-r--r-- | drivers/xen/xenbus/xenbus_xs.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c index 3f3b29398ab8..49a3874ae6bb 100644 --- a/drivers/xen/xenbus/xenbus_xs.c +++ b/drivers/xen/xenbus/xenbus_xs.c | |||
@@ -140,7 +140,9 @@ void xs_request_exit(struct xb_req_data *req) | |||
140 | spin_lock(&xs_state_lock); | 140 | spin_lock(&xs_state_lock); |
141 | xs_state_users--; | 141 | xs_state_users--; |
142 | if ((req->type == XS_TRANSACTION_START && req->msg.type == XS_ERROR) || | 142 | if ((req->type == XS_TRANSACTION_START && req->msg.type == XS_ERROR) || |
143 | req->type == XS_TRANSACTION_END) | 143 | (req->type == XS_TRANSACTION_END && |
144 | !WARN_ON_ONCE(req->msg.type == XS_ERROR && | ||
145 | !strcmp(req->body, "ENOENT")))) | ||
144 | xs_state_users--; | 146 | xs_state_users--; |
145 | spin_unlock(&xs_state_lock); | 147 | spin_unlock(&xs_state_lock); |
146 | 148 | ||