mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
gpu: nvgpu: QNX devg-nvrm crash fix.
Input paran VM Will be used to get PTE size for GVA spaces and it can be NULL if buddy_allocator initialization is not for GVA space. As part of recent changes VM was being accessed for non GVA space case and for that VM was NULL, causing the crash. In this fix added a prior check and VM will be accessed only if input flag is set to GPU_ALLOC_GVA_SPACE. Bug 200452730 Change-Id: I9dcb1f2bd5e639c37a7152b99453bb5b46fe4087 Signed-off-by: Amurthyreddy <amurthyreddy@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1842530 Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Tested-by: Prateek Sethi <prsethi@nvidia.com> Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com> Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com> Reviewed-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com>
This commit is contained in:
committed by
Alex Waterman
parent
212e8ee5d0
commit
1a3d75790d
@@ -1350,11 +1350,13 @@ int nvgpu_buddy_allocator_init(struct gk20a *g, struct nvgpu_allocator *na,
|
||||
* must be PDE aligned. If big_pages are not enabled then this
|
||||
* requirement is not necessary.
|
||||
*/
|
||||
base_big_page = base & ((vm->big_page_size << 10U) - 1U);
|
||||
size_big_page = size & ((vm->big_page_size << 10U) - 1U);
|
||||
if (is_gva_space && vm->big_pages &&
|
||||
(base_big_page != 0ULL || size_big_page != 0ULL)) {
|
||||
return -EINVAL;
|
||||
if (is_gva_space) {
|
||||
base_big_page = base & ((vm->big_page_size << 10U) - 1U);
|
||||
size_big_page = size & ((vm->big_page_size << 10U) - 1U);
|
||||
if (vm->big_pages &&
|
||||
(base_big_page != 0ULL || size_big_page != 0ULL)) {
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
a->flags = flags;
|
||||
|
||||
Reference in New Issue
Block a user