Re: [PATCH] drm/radeon: check the alloc_workqueue return value in radeon_crtc_init()

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

 



Applied.  Thanks!

On Thu, Nov 30, 2023 at 2:46 AM Yang Yingliang
<yangyingliang@xxxxxxxxxxxxxxx> wrote:
>
> From: Yang Yingliang <yangyingliang@xxxxxxxxxx>
>
> check the alloc_workqueue return value in radeon_crtc_init()
> to avoid null-ptr-deref.
>
> Fixes: fa7f517cb26e ("drm/radeon: rework page flip handling v4")
> Signed-off-by: Yang Yingliang <yangyingliang@xxxxxxxxxx>
> ---
>  drivers/gpu/drm/radeon/radeon_display.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
> index 901e75ec70ff..efd18c8d84c8 100644
> --- a/drivers/gpu/drm/radeon/radeon_display.c
> +++ b/drivers/gpu/drm/radeon/radeon_display.c
> @@ -687,11 +687,16 @@ static void radeon_crtc_init(struct drm_device *dev, int index)
>         if (radeon_crtc == NULL)
>                 return;
>
> +       radeon_crtc->flip_queue = alloc_workqueue("radeon-crtc", WQ_HIGHPRI, 0);
> +       if (!radeon_crtc->flip_queue) {
> +               kfree(radeon_crtc);
> +               return;
> +       }
> +
>         drm_crtc_init(dev, &radeon_crtc->base, &radeon_crtc_funcs);
>
>         drm_mode_crtc_set_gamma_size(&radeon_crtc->base, 256);
>         radeon_crtc->crtc_id = index;
> -       radeon_crtc->flip_queue = alloc_workqueue("radeon-crtc", WQ_HIGHPRI, 0);
>         rdev->mode_info.crtcs[index] = radeon_crtc;
>
>         if (rdev->family >= CHIP_BONAIRE) {
> --
> 2.25.1
>




[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