]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
xen/blkback: fix memory leaks
authorWenwen Wang <wenwen@cs.uga.edu>
Sun, 11 Aug 2019 17:23:22 +0000 (12:23 -0500)
committerKhalid Elmously <khalid.elmously@canonical.com>
Thu, 26 Sep 2019 04:34:52 +0000 (00:34 -0400)
commit515d44c64eeca1fe5e2d826e8de3a65d70e9cc1c
tree8e1f6afe6e8cc2348e66fc5238d7b39ddbceb186
parent0ccc039be83519ae65accea4dc0bcb42afd3e412
xen/blkback: fix memory leaks

BugLink: https://bugs.launchpad.net/bugs/1843338
[ Upstream commit ae78ca3cf3d9e9f914bfcd0bc5c389ff18b9c2e0 ]

In read_per_ring_refs(), after 'req' and related memory regions are
allocated, xen_blkif_map() is invoked to map the shared frame, irq, and
etc. However, if this mapping process fails, no cleanup is performed,
leading to memory leaks. To fix this issue, invoke the cleanup before
returning the error.

Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/block/xen-blkback/xenbus.c