]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xen/blkback: fix memory leaks
authorWenwen Wang <wenwen@cs.uga.edu>
Sun, 11 Aug 2019 17:23:22 +0000 (12:23 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Sep 2019 08:20:44 +0000 (10:20 +0200)
commit82d31c50aff90f2c7be4ac2a644368223971f431
treeb3850fe7c6bd3f23bd58462b44667ccb753688ed
parentc946f1306aaf9f0727b4e194d1b37b94ec292592
xen/blkback: fix memory leaks

[ 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>
drivers/block/xen-blkback/xenbus.c