mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-24 02:01:36 +03:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user