Skip to content

Commit 0c392cf

Browse files
mark1188-uiwangjinchao
authored andcommitted
drm/hisilicon/hibmc: fix the hibmc loaded failed bug
When hibmc loaded failed, the driver use hibmc_unload to free the resource, but the mutexes in mode.config are not init, which will access an NULL pointer. Just change goto statement to return, because hibnc_hw_init() doesn't need to free anything. Fixes: b3df5e6 ("drm/hibmc: Drop drm_vblank_cleanup") Signed-off-by: Baihan Li <[email protected]> Signed-off-by: Yongbang Shi <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
1 parent a4cae34 commit 0c392cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,13 +319,13 @@ static int hibmc_load(struct drm_device *dev)
319319

320320
ret = hibmc_hw_init(priv);
321321
if (ret)
322-
goto err;
322+
return ret;
323323

324324
ret = drmm_vram_helper_init(dev, pci_resource_start(pdev, 0),
325325
pci_resource_len(pdev, 0));
326326
if (ret) {
327327
drm_err(dev, "Error initializing VRAM MM; %d\n", ret);
328-
goto err;
328+
return ret;
329329
}
330330

331331
ret = hibmc_kms_init(priv);

0 commit comments

Comments
 (0)