Skip to content

Commit

Permalink
pvcalls-front: fixes incorrect error handling
Browse files Browse the repository at this point in the history
kfree() is incorrectly used to release the pages allocated by
__get_free_page() and __get_free_pages(). Use the matching deallocators
i.e., free_page() and free_pages(), respectively.

Signed-off-by: Pan Bian <[email protected]>
Reviewed-by: Stefano Stabellini <[email protected]>
Signed-off-by: Juergen Gross <[email protected]>
  • Loading branch information
SinkFinder authored and jgross1 committed Nov 29, 2018
1 parent 1236641 commit 975ef94
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 @@ -385,8 +385,8 @@ static int create_active(struct sock_mapping *map, int *evtchn)
out_error:
if (*evtchn >= 0)
xenbus_free_evtchn(pvcalls_front_dev, *evtchn);
kfree(map->active.data.in);
kfree(map->active.ring);
free_pages((unsigned long)map->active.data.in, PVCALLS_RING_ORDER);
free_page((unsigned long)map->active.ring);
return ret;
}

Expand Down

0 comments on commit 975ef94

Please sign in to comment.