mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 09:57:08 +03:00
nvgpu_gr_config_get_sm_info() returns NULL if invalid SM id is provided to the API. Since it is possible return NULL, a NULL check is required at all callers. Also, nvgpu_gr_config_get_sm_info() is always called in a loop from 0 to (sm_count - 1) and hence adding an nvgpu_assert() should be sufficient. Change-Id: I0fd92ac354447796c4c7d7237e7bd3b6e5c2682c Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2552409 (cherry picked from commit 4f3789d6563bbfe1be3e25c522ca1eac0d5d2d13) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2558271 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com> Reviewed-by: V M S Seeta Rama Raju Mudundi <srajum@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>