All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Clark <robdclark@gmail.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	Archit Taneja <architt@codeaurora.org>,
	DRI Development <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 1/4] drm: Make drm_fb_unregister/remove accept NULL fb
Date: Tue, 25 Aug 2015 15:19:37 -0400	[thread overview]
Message-ID: <CAF6AEGs4U4+QXCOLa_EhwB81hZ2zcHybN+tN+WCG8eCHyxvL9Q@mail.gmail.com> (raw)
In-Reply-To: <1440510314-8633-1-git-send-email-daniel.vetter@ffwll.ch>

On Tue, Aug 25, 2015 at 9:45 AM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> These functions are used by drivers to release fbdev emulation
> buffers. We need to make them resilient to NULL pointers to
> make the fbdev compile/runtime knobs not cause Oopses on module
> unload.
>
> Cc: Archit Taneja <architt@codeaurora.org>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Reviewed-by: Rob Clark <robdclark@gmail.com>

> ---
>  drivers/gpu/drm/drm_crtc.c | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index 33d877c65ced..884690c81094 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -538,7 +538,12 @@ EXPORT_SYMBOL(drm_framebuffer_reference);
>   */
>  void drm_framebuffer_unregister_private(struct drm_framebuffer *fb)
>  {
> -       struct drm_device *dev = fb->dev;
> +       struct drm_device *dev;
> +
> +       if (!fb)
> +               return;
> +
> +       dev = fb->dev;
>
>         mutex_lock(&dev->mode_config.fb_lock);
>         /* Mark fb as reaped and drop idr ref. */
> @@ -589,12 +594,17 @@ EXPORT_SYMBOL(drm_framebuffer_cleanup);
>   */
>  void drm_framebuffer_remove(struct drm_framebuffer *fb)
>  {
> -       struct drm_device *dev = fb->dev;
> +       struct drm_device *dev;
>         struct drm_crtc *crtc;
>         struct drm_plane *plane;
>         struct drm_mode_set set;
>         int ret;
>
> +       if (!fb)
> +               return;
> +
> +       dev = fb->dev;
> +
>         WARN_ON(!list_empty(&fb->filp_head));
>
>         /*
> --
> 1.8.3.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

      parent reply	other threads:[~2015-08-25 19:19 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-25 13:45 [PATCH 1/4] drm: Make drm_fb_unregister/remove accept NULL fb Daniel Vetter
2015-08-25 13:45 ` [PATCH 2/4] drm/fb-helper: Use -errno return in restore_mode_unlocked Daniel Vetter
2015-08-25 15:20   ` [PATCH] " Daniel Vetter
2015-08-25 19:20     ` Rob Clark
2015-08-26 11:36       ` Daniel Vetter
2015-08-29 19:04     ` shuang.he
2015-08-25 13:45 ` [PATCH 3/4] drm/fb-helper: Add module option to disable fbdev emulation Daniel Vetter
2015-08-26  5:12   ` Archit Taneja
2015-08-26  8:44     ` Archit Taneja
2015-08-26 11:34       ` Daniel Vetter
2015-08-26 11:37         ` Daniel Vetter
2015-08-26 12:29           ` Archit Taneja
2015-08-26 12:51             ` Daniel Vetter
2015-08-26 12:18         ` Archit Taneja
2015-08-25 13:45 ` [PATCH 4/4] fbdev: Debug knob to register without holding console_lock Daniel Vetter
2015-08-25 13:45   ` Daniel Vetter
2015-08-25 19:24   ` Rob Clark
2015-08-25 19:24     ` Rob Clark
2015-09-01 10:32     ` Tomi Valkeinen
2015-09-01 10:32       ` Tomi Valkeinen
2015-09-01 14:34       ` Rob Clark
2015-09-01 14:34         ` Rob Clark
2015-09-01 14:41         ` Tomi Valkeinen
2015-09-01 14:41           ` Tomi Valkeinen
2015-09-01 15:12           ` Rob Clark
2015-09-01 15:12             ` Rob Clark
2015-09-01 15:31             ` Daniel Vetter
2015-09-01 15:31               ` Daniel Vetter
2015-09-24 10:56         ` Tomi Valkeinen
2015-09-24 10:56           ` Tomi Valkeinen
2015-12-07 17:32   ` Tomi Valkeinen
2015-12-07 17:32     ` Tomi Valkeinen
2015-12-08  8:19     ` Daniel Vetter
2015-12-08  8:19       ` Daniel Vetter
2015-12-08  8:26       ` Tomi Valkeinen
2015-12-08  8:26         ` Tomi Valkeinen
2015-08-25 19:19 ` Rob Clark [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAF6AEGs4U4+QXCOLa_EhwB81hZ2zcHybN+tN+WCG8eCHyxvL9Q@mail.gmail.com \
    --to=robdclark@gmail.com \
    --cc=architt@codeaurora.org \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.