mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: sysfs adding NULL pointer check
golden image size will be set when memory allocated. See function: - nvgpu_gr_obj_ctx_init If golden image size is 0, gr_golden_image should be a NULL pointer in most cases. So add NULL pointer checking in tpc_pg_mask_store to avoid NULL pointer exception. Bug 2403210 Change-Id: I14df5cd94d7a4418c3089c5f84b6eab93c485ba6 Signed-off-by: Sunny Li <sunnyl@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2161280 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Debarshi Dutta <ddutta@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
@@ -853,7 +853,9 @@ static ssize_t tpc_pg_mask_store(struct device *dev,
|
|||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nvgpu_gr_obj_ctx_get_golden_image_size(gr_golden_image) != 0) {
|
if (gr_golden_image &&
|
||||||
|
nvgpu_gr_obj_ctx_get_golden_image_size(gr_golden_image)
|
||||||
|
!= 0) {
|
||||||
nvgpu_err(g, "golden image size already initialized");
|
nvgpu_err(g, "golden image size already initialized");
|
||||||
nvgpu_mutex_release(&g->tpc_pg_lock);
|
nvgpu_mutex_release(&g->tpc_pg_lock);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|||||||
Reference in New Issue
Block a user