summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorAndrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>2021-06-10 14:30:21 +0000
committerAndrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>2021-06-10 14:30:21 +0000
commit276aedc8f14ef8063b7cdda81d7de372500d1fce (patch)
tree51a9b4fde1fe920dfe0de57a1c7e18d7f5631bb5 /samples
parent1ea800399c603f400dd34baa5705c11551ad4b70 (diff)
parent3909e2374335335c9504467caabc906d3f7487e4 (diff)
Merge tag 'v5.4.125' into 5.4-2.3.x-imx
This is the 5.4.125 stable release Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
Diffstat (limited to 'samples')
-rw-r--r--samples/vfio-mdev/mdpy-fb.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/samples/vfio-mdev/mdpy-fb.c b/samples/vfio-mdev/mdpy-fb.c
index 2719bb259653..a760e130bd0d 100644
--- a/samples/vfio-mdev/mdpy-fb.c
+++ b/samples/vfio-mdev/mdpy-fb.c
@@ -117,22 +117,27 @@ static int mdpy_fb_probe(struct pci_dev *pdev,
if (format != DRM_FORMAT_XRGB8888) {
pci_err(pdev, "format mismatch (0x%x != 0x%x)\n",
format, DRM_FORMAT_XRGB8888);
- return -EINVAL;
+ ret = -EINVAL;
+ goto err_release_regions;
}
if (width < 100 || width > 10000) {
pci_err(pdev, "width (%d) out of range\n", width);
- return -EINVAL;
+ ret = -EINVAL;
+ goto err_release_regions;
}
if (height < 100 || height > 10000) {
pci_err(pdev, "height (%d) out of range\n", height);
- return -EINVAL;
+ ret = -EINVAL;
+ goto err_release_regions;
}
pci_info(pdev, "mdpy found: %dx%d framebuffer\n",
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;