Skip to content

Commit f1f63cb

Browse files
tititiou36liuw
authored andcommitted
drm/hyperv: Fix an error handling path in hyperv_vmbus_probe()
hyperv_setup_vram() calls vmbus_allocate_mmio(). This must be undone in the error handling path of the probe, as already done in the remove function. Fixes: a0ab5ab ("drm/hyperv : Removing the restruction of VRAM allocation with PCI bar size") Signed-off-by: Christophe JAILLET <[email protected]> Reviewed-by: Michael Kelley <[email protected]> Link: https://lore.kernel.org/r/7dfa372af3e35fbb1d6f157183dfef2e4512d3be.1659297696.git.christophe.jaillet@wanadoo.fr Signed-off-by: Wei Liu <[email protected]>
1 parent 568035b commit f1f63cb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/gpu/drm/hyperv/hyperv_drm_drv.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ static int hyperv_vmbus_probe(struct hv_device *hdev,
133133
}
134134

135135
ret = hyperv_setup_vram(hv, hdev);
136-
137136
if (ret)
138137
goto err_vmbus_close;
139138

@@ -150,18 +149,20 @@ static int hyperv_vmbus_probe(struct hv_device *hdev,
150149

151150
ret = hyperv_mode_config_init(hv);
152151
if (ret)
153-
goto err_vmbus_close;
152+
goto err_free_mmio;
154153

155154
ret = drm_dev_register(dev, 0);
156155
if (ret) {
157156
drm_err(dev, "Failed to register drm driver.\n");
158-
goto err_vmbus_close;
157+
goto err_free_mmio;
159158
}
160159

161160
drm_fbdev_generic_setup(dev, 0);
162161

163162
return 0;
164163

164+
err_free_mmio:
165+
vmbus_free_mmio(hv->mem->start, hv->fb_size);
165166
err_vmbus_close:
166167
vmbus_close(hdev->channel);
167168
err_hv_set_drv_data:

0 commit comments

Comments
 (0)