gpu: nvgpu: vm: plausibility check for nvgpu_vm_bind_channel

Ensure that the channel pointer passed to nvgpu_vm_bind_channel
is not NULL.
Update unit test accordingly.

JIRA NVGPU-4947.

Change-Id: I3f987ee9042066df83cc6101b20b4add3661fae8
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2291034
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: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Nicolas Benech
2020-02-06 11:19:08 -05:00
committed by Alex Waterman
parent 16b80d2c5c
commit e8c02f121b
3 changed files with 17 additions and 1 deletions

View File

@@ -286,7 +286,7 @@ int test_nvgpu_vm_alloc_va(struct unit_module *m, struct gk20a *g,
*
* Description: This test targets the nvgpu_vm_bind_channel API.
*
* Test Type: Feature
* Test Type: Feature, Error injection
*
* Targets: gops_mm.vm_bind_channel, nvgpu_vm_bind_channel
*
@@ -299,6 +299,8 @@ int test_nvgpu_vm_alloc_va(struct unit_module *m, struct gk20a *g,
* - Address space size = 128GB
* - Kernel reserved space size = 4GB
* - Create an empty nvgpu_channel instance.
* - Call the nvgpu_vm_bind_channel with a NULL channel pointer and ensure it
* failed.
* - Call the nvgpu_vm_bind_channel API with the empty channel instance.
* - Ensure that after the call, the VM pointer in the nvgpu_channel structure
* points to the VM in use in the test.