Re: [PATCH 1/4] drm/scheduler: trivial error handling fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 14, 2018 at 10:12:23AM +0200, Christian König wrote:
> Return -ENOMEM when allocating the rq_list fails.
> 
> Signed-off-by: Christian König <christian.koenig@xxxxxxx>

Reviewed-by: Huang Rui <ray.huang@xxxxxxx>

> ---
>  drivers/gpu/drm/scheduler/gpu_scheduler.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler.c b/drivers/gpu/drm/scheduler/gpu_scheduler.c
> index f566405f49e3..85c1f95752cc 100644
> --- a/drivers/gpu/drm/scheduler/gpu_scheduler.c
> +++ b/drivers/gpu/drm/scheduler/gpu_scheduler.c
> @@ -191,6 +191,9 @@ int drm_sched_entity_init(struct drm_sched_entity *entity,
>  	entity->num_rq_list = num_rq_list;
>  	entity->rq_list = kcalloc(num_rq_list, sizeof(struct drm_sched_rq *),
>  				GFP_KERNEL);
> +	if (!entity->rq_list)
> +		return -ENOMEM;
> +
>  	for (i = 0; i < num_rq_list; ++i)
>  		entity->rq_list[i] = rq_list[i];
>  	entity->last_scheduled = NULL;
> -- 
> 2.14.1
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux