misc: mods: fix offset for large allocations

Fix MODS_VIRTUAL_TO_PHYSICAL for allocations exceeding 4GB

It's unlikely for us to support such large allocations,
but if we ever did, integer overflow would truncate the
allocation offset, resulting in the incorrect PA being
returned.

This change also brings the driver up to date with
the Perforce copy and fixes the version.

CID 421846

Change-Id: Ia9328dd91743631f39a16dfc3077261656384f2c
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2810261
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Chris Dragan
2022-11-16 02:37:10 -08:00
committed by Laxman Dewangan
parent 83161a6ce4
commit 8061cf233b
2 changed files with 12 additions and 10 deletions

View File

@@ -25,7 +25,7 @@
/* Driver version */
#define MODS_DRIVER_VERSION_MAJOR 4
#define MODS_DRIVER_VERSION_MINOR 10
#define MODS_DRIVER_VERSION_MINOR 12
#define MODS_DRIVER_VERSION ((MODS_DRIVER_VERSION_MAJOR << 8) | \
((MODS_DRIVER_VERSION_MINOR / 10) << 4) | \
(MODS_DRIVER_VERSION_MINOR % 10))