[PATCH 43/83] hsa/radeon: NULL pointer dereference bug workaround
From: Alexey Skidanov Signed-off-by: Alexey Skidanov Signed-off-by: Oded Gabbay --- drivers/gpu/hsa/radeon/kfd_sched_cik_static.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/hsa/radeon/kfd_sched_cik_static.c b/drivers/gpu/hsa/radeon/kfd_sched_cik_static.c index 7573d25..7ee8125 100644 --- a/drivers/gpu/hsa/radeon/kfd_sched_cik_static.c +++ b/drivers/gpu/hsa/radeon/kfd_sched_cik_static.c @@ -627,8 +627,10 @@ static void cik_static_deregister_process(struct kfd_scheduler *scheduler, struct cik_static_private *priv = kfd_scheduler_to_private(scheduler); struct cik_static_process *pp = kfd_process_to_private(scheduler_process); - release_vmid(priv, pp->vmid); - kfree(pp); + if (priv && pp) { + release_vmid(priv, pp->vmid); + kfree(pp); + } } static bool allocate_hqd(struct cik_static_private *priv, unsigned int *queue) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 43/83] hsa/radeon: NULL pointer dereference bug workaround
From: Alexey Skidanov alexey.skida...@amd.com Signed-off-by: Alexey Skidanov alexey.skida...@amd.com Signed-off-by: Oded Gabbay oded.gab...@amd.com --- drivers/gpu/hsa/radeon/kfd_sched_cik_static.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/hsa/radeon/kfd_sched_cik_static.c b/drivers/gpu/hsa/radeon/kfd_sched_cik_static.c index 7573d25..7ee8125 100644 --- a/drivers/gpu/hsa/radeon/kfd_sched_cik_static.c +++ b/drivers/gpu/hsa/radeon/kfd_sched_cik_static.c @@ -627,8 +627,10 @@ static void cik_static_deregister_process(struct kfd_scheduler *scheduler, struct cik_static_private *priv = kfd_scheduler_to_private(scheduler); struct cik_static_process *pp = kfd_process_to_private(scheduler_process); - release_vmid(priv, pp-vmid); - kfree(pp); + if (priv pp) { + release_vmid(priv, pp-vmid); + kfree(pp); + } } static bool allocate_hqd(struct cik_static_private *priv, unsigned int *queue) -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/