diff options
author | Stefano Stabellini <sstabellini@kernel.org> | 2018-12-22 02:06:30 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-02-27 12:08:50 +0300 |
commit | 81b8519de1b4f94de7cf0227fae9591a98ad768c (patch) | |
tree | aa6c531635a0607d51a72c87252d983d75eff766 /drivers/xen | |
parent | 9699f7a70eb8088f7b1f88b63f95dec78c45054e (diff) | |
download | linux-81b8519de1b4f94de7cf0227fae9591a98ad768c.tar.xz |
pvcalls-front: don't try to free unallocated rings
[ Upstream commit 96283f9a084e23d7cda2d3c5d1ffa6df6cf1ecec ]
inflight_req_id is 0 when initialized. If inflight_req_id is 0, there is
no accept_map to free. Fix the check in pvcalls_front_release.
Signed-off-by: Stefano Stabellini <stefanos@xilinx.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/xen')
-rw-r--r-- | drivers/xen/pvcalls-front.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/xen/pvcalls-front.c b/drivers/xen/pvcalls-front.c index e5d95aab2cb8..4f3d664b3f39 100644 --- a/drivers/xen/pvcalls-front.c +++ b/drivers/xen/pvcalls-front.c @@ -1030,8 +1030,8 @@ int pvcalls_front_release(struct socket *sock) spin_lock(&bedata->socket_lock); list_del(&map->list); spin_unlock(&bedata->socket_lock); - if (READ_ONCE(map->passive.inflight_req_id) != - PVCALLS_INVALID_ID) { + if (READ_ONCE(map->passive.inflight_req_id) != PVCALLS_INVALID_ID && + READ_ONCE(map->passive.inflight_req_id) != 0) { pvcalls_front_free_map(bedata, map->passive.accept_map); } |