[MODS]Check return value of dma_request_chan

Bug 4766784

Change-Id: Ib82eaa709717a43b34066f52fcf47fd5bdd07c72
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3192131
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: Shawn Bai <xueyuanb@nvidia.com>
Reviewed-by: Shawn Bai <xueyuanb@nvidia.com>
Reviewed-by: Akhil R <akhilrajeev@nvidia.com>
This commit is contained in:
Shawn Bai
2024-08-12 02:47:30 -04:00
committed by mobile promotions
parent 564d844a70
commit 612482b7df

View File

@@ -213,6 +213,14 @@ int esc_mods_dma_request_channel_2(struct mods_client *client,
cl_debug(DEBUG_TEGRADMA, "dmach is asked for %s\n", p_handle->ctrl_dir); cl_debug(DEBUG_TEGRADMA, "dmach is asked for %s\n", p_handle->ctrl_dir);
chan = dma_request_chan(mods_tegra_dma_dev, p_handle->ctrl_dir); chan = dma_request_chan(mods_tegra_dma_dev, p_handle->ctrl_dir);
} }
if (IS_ERR(chan)) {
mods_release_dma_id(id);
err = -ENOPARAM;
pr_err("failed to alloc chan for %s, errno %ld\n", (p_handle->ctrl_dir[0] == '\0') ? "" : p_handle->ctrl_dir, PTR_ERR(chan));
goto failed;
}
else
if (!chan) { if (!chan) {
cl_error("dma channel is not available\n"); cl_error("dma channel is not available\n");
mods_release_dma_id(id); mods_release_dma_id(id);