Skip to content

Commit 96283f9

Browse files
sstabelliniBoris Ostrovsky
authored andcommitted
pvcalls-front: don't try to free unallocated rings
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>
1 parent b79470b commit 96283f9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/xen/pvcalls-front.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,8 +1030,8 @@ int pvcalls_front_release(struct socket *sock)
10301030
spin_lock(&bedata->socket_lock);
10311031
list_del(&map->list);
10321032
spin_unlock(&bedata->socket_lock);
1033-
if (READ_ONCE(map->passive.inflight_req_id) !=
1034-
PVCALLS_INVALID_ID) {
1033+
if (READ_ONCE(map->passive.inflight_req_id) != PVCALLS_INVALID_ID &&
1034+
READ_ONCE(map->passive.inflight_req_id) != 0) {
10351035
pvcalls_front_free_map(bedata,
10361036
map->passive.accept_map);
10371037
}

0 commit comments

Comments
 (0)