Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4e876c2b authored by Bob Liu's avatar Bob Liu Committed by Konrad Rzeszutek Wilk
Browse files

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: default avatarBob Liu <bob.liu@oracle.com>
Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
parent 172335ad
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -2442,7 +2442,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;
	}

	xenbus_switch_state(info->xbdev, XenbusStateConnected);
@@ -2455,6 +2455,11 @@ static void blkfront_connect(struct blkfront_info *info)
	device_add_disk(&info->xbdev->dev, info->gd);

	info->is_ready = 1;
	return;

fail:
	blkif_free(info, 0);
	return;
}

/**