> +++ b/drivers/gpu/drm/drm_atomic_uapi.c
> @@ -1458,10 +1458,12 @@ static int prepare_signaling(struct drm_device *dev,
>                       struct dma_fence *fence;
>                       struct drm_out_fence_state *f;
>  
> +                     ret = -ENOMEM;
> +

How do you think about to refine the source code a bit more?

I imagine that this assignment statement can be moved behind an additional label
like e_nomem.


>                       f = krealloc(*fence_state, sizeof(**fence_state) *
>                                    (*num_fences + 1), GFP_KERNEL);
>                       if (!f)
> -                             return -ENOMEM;
> +                             goto err_free_event;
>  
>                       memset(&f[*num_fences], 0, sizeof(*f));
>  


…
> @@ -1531,6 +1533,11 @@ static int prepare_signaling(struct drm_device *dev,
>       }
>  
>       return 0;
> +
> +err_free_event:
> +     drm_event_cancel_free(dev, &crtc_state->event->base);

+err_reset_event:

Would you like to avoid a bit of duplicate source code from an other if branch?
https://elixir.bootlin.com/linux/v7.3-rc1/source/drivers/gpu/drm/drm_atomic_uapi.c#L1457-L1461

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v7.3-rc2#n572


> +     crtc_state->event = NULL;
> +     return ret;
>  }


Regards,
Markus

Reply via email to