mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
Fix NULL pointer dereference when num_unpins is 0, which causes job->addr_phys to be NULL. In this case, the code was incorrectly trying to set job->gather_addr_phys to &job->addr_phys[num_relocs], which would dereference a NULL pointer. Add proper NULL checks to prevent this issue both during allocation and when using job->gather_addr_phys throughout the code. Fixes CID 12627383: - CERT-C Expression (CERT EXP34-C) Fixes CID 12627953: - Explicit null dereferenced (FORWARD_NULL) Jira HOSTX-5971 Change-Id: If417ec5b5431a4f4b716ca73ddf279c9b0336c94 Signed-off-by: Mainak Sen <msen@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3324441 Reviewed-by: Raghavendra Vishnu Kumar <rvk@nvidia.com> GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: Vamsee Vardhan Thummala <vthummala@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>