diff mbox

sample: vfio/mdev: add a missing error code

Message ID 20180516092857.GA25195@mwanda (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter May 16, 2018, 9:28 a.m. UTC
We forgot to set "ret = -ENOMEM;" here.

Fixes: 2933b7a9b2fd ("sample: vfio mdev display - guest driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff mbox

Patch

diff --git a/samples/vfio-mdev/mdpy-fb.c b/samples/vfio-mdev/mdpy-fb.c
index 2719bb259653..6fe0187f47a2 100644
--- a/samples/vfio-mdev/mdpy-fb.c
+++ b/samples/vfio-mdev/mdpy-fb.c
@@ -131,8 +131,10 @@  static int mdpy_fb_probe(struct pci_dev *pdev,
 		 width, height);
 
 	info = framebuffer_alloc(sizeof(struct mdpy_fb_par), &pdev->dev);
-	if (!info)
+	if (!info) {
+		ret = -ENOMEM;
 		goto err_release_regions;
+	}
 	pci_set_drvdata(pdev, info);
 	par = info->par;