mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 18:12:41 +03:00
gpu: nvgpu: fix memory fault in invalid_pd_alloc
nvgpu_pd_alloc() calls gk20a_from_vm which is extracting g from vm->mm->g without assigning mm pointer to vm->mm. Assigning the pointers. Bug 200577095 Change-Id: Ibe2757b0616fd8e87df509abe5d85e90d989d45c Signed-off-by: Prateek sethi <prsethi@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2264751 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Thomas Fleury <tfleury@nvidia.com> Reviewed-by: Philip Elcan <pelcan@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com> Reviewed-by: Shashank Singh <shashsingh@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Alex Waterman
parent
ae8f71a462
commit
28d21878a7
@@ -350,6 +350,9 @@ int test_pd_alloc_invalid_input(struct unit_module *m, struct gk20a *g,
|
|||||||
struct nvgpu_gmmu_pd pd;
|
struct nvgpu_gmmu_pd pd;
|
||||||
u32 i, garbage[] = { 0U, 128U, 255U, 4095U, 3000U, 128U, 2049U };
|
u32 i, garbage[] = { 0U, 128U, 255U, 4095U, 3000U, 128U, 2049U };
|
||||||
|
|
||||||
|
g->mm.g = g;
|
||||||
|
vm.mm = &g->mm;
|
||||||
|
|
||||||
if (g->mm.pd_cache != NULL) {
|
if (g->mm.pd_cache != NULL) {
|
||||||
unit_return_fail(m, "pd_cache already inited\n");
|
unit_return_fail(m, "pd_cache already inited\n");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user