History

Merge tag 'vfio-v5.13-rc5' of git://github.com/awilliam/linux-vfio

Pull VFIO fixes from Alex Williamson: - Fix error path return value (Zhen Lei) - Add vfio-pci CONFIG_MMU dependency (Randy Dunlap) - Replace open coding with struct_size() (Gustavo A. R. Silva) - Fix sample driver error path (Wei Yongjun) - Fix vfio-platform error path module_put() (Max Gurtovoy) * tag 'vfio-v5.13-rc5' of git://github.com/awilliam/linux-vfio: vfio/platform: fix module_put call in error flow samples: vfio-mdev: fix error handing in mdpy_fb_probe() vfio/iommu_type1: Use struct_size() for kzalloc() vfio/pci: zap_vma_ptes() needs MMU vfio/pci: Fix error return code in vfio_ecap_init()

Linus Torvalds committed 5 years ago

Commit f88cd3f2 parents 143d28d dc51ff95 files · +13 −7Browse files

Showing the changes to samples (1 of 5 files). Show all

Unified · Split

samples/vfio-mdev/mdpy-fb.c+9−4
@@ -117,22 +117,27 @@ static int mdpy_fb_probe(struct pci_dev *pdev, · 116 unmodified lines
117117 if (format != DRM_FORMAT_XRGB8888) {
118118 pci_err(pdev, "format mismatch (0x%x != 0x%x)\n",
119119 format, DRM_FORMAT_XRGB8888);
120− return -EINVAL;
120+ ret = -EINVAL;
121+ goto err_release_regions;
121122 }
122123 if (width < 100 || width > 10000) {
123124 pci_err(pdev, "width (%d) out of range\n", width);
124− return -EINVAL;
125+ ret = -EINVAL;
126+ goto err_release_regions;
125127 }
126128 if (height < 100 || height > 10000) {
127129 pci_err(pdev, "height (%d) out of range\n", height);
128− return -EINVAL;
130+ ret = -EINVAL;
131+ goto err_release_regions;
129132 }
130133 pci_info(pdev, "mdpy found: %dx%d framebuffer\n",
131134 width, height);
132135
133136 info = framebuffer_alloc(sizeof(struct mdpy_fb_par), &pdev->dev);
134− if (!info)
137+ if (!info) {
138+ ret = -ENOMEM;
135139 goto err_release_regions;
140+ }
136141 pci_set_drvdata(pdev, info);
137142 par = info->par;
138143