Skip to content

Commit

Permalink
pvcalls-front: don't try to free unallocated rings
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Boris Ostrovsky <[email protected]>
Signed-off-by: Boris Ostrovsky <[email protected]>
  • Loading branch information
sstabellini authored and Boris Ostrovsky committed Jan 2, 2019
1 parent b79470b commit 96283f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/xen/pvcalls-front.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 96283f9

Please sign in to comment.