]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
xen/balloon: fix accounting in alloc_xenballooned_pages error path
authorRoger Pau Monne <roger.pau@citrix.com>
Mon, 27 Jul 2020 09:13:39 +0000 (11:13 +0200)
committerJuergen Gross <jgross@suse.com>
Mon, 3 Aug 2020 06:14:01 +0000 (08:14 +0200)
commit1951fa33ec259abdf3497bfee7b63e7ddbb1a394
tree6289dd4407134ea8e8a09da5061b93bdbbee58c9
parent4e722d4fe27899f90491065edb0bb0a757f0b955
xen/balloon: fix accounting in alloc_xenballooned_pages error path

target_unpopulated is incremented with nr_pages at the start of the
function, but the call to free_xenballooned_pages will only subtract
pgno number of pages, and thus the rest need to be subtracted before
returning or else accounting will be skewed.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20200727091342.52325-2-roger.pau@citrix.com
Signed-off-by: Juergen Gross <jgross@suse.com>
drivers/xen/balloon.c