Divya b4b98aba02 gpu: nvgpu: reorder elpg and elpg_ms flags check
- In rmmod path, gr struct is freed first and then
  info_mem_destroy is called which calls elpg_ms
  protected call. This in turn waits for gr init
  where gr struct is accessed. This could lead to
  NULL access.
- move elpg and elpg_ms flag check before checking
  pg initialized and gr wait conditions to avoid
  the NULL access issue.

Bug 3848290

Change-Id: I088d89d7876405cc7abedb777884b442726e992f
Signed-off-by: Divya <dsinghatwari@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2811131
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-01 11:03:05 -08:00
Description
No description provided
42 MiB