]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Aug 2020 07:48:16 +0000 (09:48 +0200)
commit6235d910a5b85ec92cd3da929cb57971fb530f88
tree6ba17ab9539be78ec06dffe69a80feff50a399b2
parent0673b5b73c6ed8c2a6e08770d0b3d6ec0078cbf3
xen/balloon: fix accounting in alloc_xenballooned_pages error path

commit 1951fa33ec259abdf3497bfee7b63e7ddbb1a394 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/xen/balloon.c