From: Bob Liu Date: Wed, 27 Jul 2016 09:42:04 +0000 (+0800) Subject: xen-blkfront: free resources if xlvbd_alloc_gendisk fails X-Git-Tag: v4.1.12-92~55^2~4 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=04abe368c38c879f37bb4eb6f40688ed2d4879ce;p=users%2Fjedix%2Flinux-maple.git xen-blkfront: free resources if xlvbd_alloc_gendisk fails Current code forgets to free resources in the failure path of xlvbd_alloc_gendisk(), this patch fix it. Signed-off-by: Bob Liu Signed-off-by: Konrad Rzeszutek Wilk (cherry picked from commit 4e876c2bd37fbb5c37a4554a79cf979d486f0e82) Signed-off-by: Bob Liu Orabug: 24820937 Conflicts: drivers/block/xen-blkfront.c --- diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 0dc08d9f60efc..e86b2ffd5a1e2 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -2691,7 +2691,7 @@ static void blkfront_connect(struct blkfront_info *info) if (err) { xenbus_dev_fatal(info->xbdev, err, "xlvbd_add at %s", info->xbdev->otherend); - return; + goto fail; } err = device_create_file(&info->xbdev->dev, &dev_attr_max_ring_page_order);