Skip to content

Commit

Permalink
gpu: host1x: Fix an error handling path in 'host1x_probe()'
Browse files Browse the repository at this point in the history
Add the missing 'host1x_bo_cache_destroy()' call in the error handling
path of the probe, as already done in the remove function.

In order to simplify the error handling, move the 'host1x_bo_cache_init()'
call after all the devm_ function.

Fixes: 1f39b1d ("drm/tegra: Implement buffer object cache")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Thierry Reding <treding@nvidia.com>
  • Loading branch information
Christophe JAILLET authored and Thierry Reding committed Mar 1, 2022
1 parent cea4188 commit e5d5db1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/gpu/host1x/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,6 @@ static int host1x_probe(struct platform_device *pdev)
if (syncpt_irq < 0)
return syncpt_irq;

host1x_bo_cache_init(&host->cache);
mutex_init(&host->devices_lock);
INIT_LIST_HEAD(&host->devices);
INIT_LIST_HEAD(&host->list);
Expand Down Expand Up @@ -489,10 +488,12 @@ static int host1x_probe(struct platform_device *pdev)
if (err)
return err;

host1x_bo_cache_init(&host->cache);

err = host1x_iommu_init(host);
if (err < 0) {
dev_err(&pdev->dev, "failed to setup IOMMU: %d\n", err);
return err;
goto destroy_cache;
}

err = host1x_channel_list_init(&host->channel_list,
Expand Down Expand Up @@ -553,6 +554,8 @@ static int host1x_probe(struct platform_device *pdev)
host1x_channel_list_free(&host->channel_list);
iommu_exit:
host1x_iommu_exit(host);
destroy_cache:
host1x_bo_cache_destroy(&host->cache);

return err;
}
Expand Down

0 comments on commit e5d5db1

Please sign in to comment.