mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-25 02:52:51 +03:00
gpu: nvgpu: ce: move exec input checks up
Check the sanity of some input arguments already as the first thing so that a better error code can be returned. Jira NVGPU-5172 Change-Id: I1c847c10166471e520d0e9aaeeef606bd7d8634e Signed-off-by: Konsta Hölttä <kholtta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2402030 Reviewed-by: automaticguardword <automaticguardword@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> Reviewed-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Alex Waterman
parent
82b4a8e825
commit
aafc9a4511
@@ -78,6 +78,18 @@ int nvgpu_ce_execute_ops(struct gk20a *g,
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* This shouldn't happen */
|
||||
if (size == 0ULL) {
|
||||
ret = -EINVAL;
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (request_operation != NVGPU_CE_PHYS_MODE_TRANSFER &&
|
||||
request_operation != NVGPU_CE_MEMSET) {
|
||||
ret = -EINVAL;
|
||||
goto end;
|
||||
}
|
||||
|
||||
nvgpu_mutex_acquire(&ce_app->app_mutex);
|
||||
|
||||
nvgpu_list_for_each_entry_safe(ce_ctx, ce_ctx_save,
|
||||
@@ -319,11 +331,6 @@ u32 nvgpu_ce_prepare_submit(u64 src_buf,
|
||||
u64 low, hi;
|
||||
bool mode_transfer = (request_operation == NVGPU_CE_PHYS_MODE_TRANSFER);
|
||||
|
||||
/* failure case handling */
|
||||
if ((size == 0ULL) || (request_operation > NVGPU_CE_MEMSET)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* set the channel object */
|
||||
cmd_buf_cpu_va[methodSize++] = 0x20018000;
|
||||
cmd_buf_cpu_va[methodSize++] = dma_copy_class;
|
||||
|
||||
Reference in New Issue
Block a user