video: tegra: nvmap: Fix INT08-C using overflow.h

JIRA: TMM-5724
Bug 4479044

Change-Id: I72fd476edf686a2154a8976fdeb4a686a24ddbb8
Signed-off-by: Surbhi Singh <surbhis@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3233433
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Surbhi Singh
2024-10-19 19:21:17 +00:00
committed by Jon Hunter
parent 44a095795e
commit a47c3ef56d

View File

@@ -171,8 +171,12 @@ static vm_fault_t nvmap_vma_fault(struct vm_fault *vmf)
unsigned long offs;
struct vm_area_struct *vma = vmf->vma;
unsigned long vmf_address = vmf->address;
unsigned long difference;
offs = (unsigned long)(vmf_address - vma->vm_start);
if (check_sub_overflow(vmf_address, (unsigned long)vma->vm_start, &difference))
return VM_FAULT_SIGBUS;
offs = difference;
priv = vma->vm_private_data;
if (priv == NULL || priv->handle == NULL || !priv->handle->alloc)
return VM_FAULT_SIGBUS;