* [PATCH] drm/rockchip: only call drm_fb_helper_hotplug_event if fb_helper present
@ 2015-06-02 14:41 Heiko Stübner
2015-06-03 3:41 ` Mark yao
0 siblings, 1 reply; 2+ messages in thread
From: Heiko Stübner @ 2015-06-02 14:41 UTC (permalink / raw)
To: Mark Yao
Cc: David Airlie, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
djkurtz-F7+t8E8rja9g9hUCZPvPmw
Add a check for the presence of fb_helper to rockchip_drm_output_poll_changed()
to only call drm_fb_helper_hotplug_event if there is actually a fb_helper
available. Without this check I see NULL pointer dereferences when the
hdmi hotplug irq fires before the fb_helper got initialized.
Signed-off-by: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
---
Fix to variant as seen on at least Exynos, Armada and Omap
drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
index 77d5289..002645b 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
@@ -162,7 +162,8 @@ static void rockchip_drm_output_poll_changed(struct drm_device *dev)
struct rockchip_drm_private *private = dev->dev_private;
struct drm_fb_helper *fb_helper = &private->fbdev_helper;
- drm_fb_helper_hotplug_event(fb_helper);
+ if (fb_helper)
+ drm_fb_helper_hotplug_event(fb_helper);
}
static const struct drm_mode_config_funcs rockchip_drm_mode_config_funcs = {
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/rockchip: only call drm_fb_helper_hotplug_event if fb_helper present
2015-06-02 14:41 [PATCH] drm/rockchip: only call drm_fb_helper_hotplug_event if fb_helper present Heiko Stübner
@ 2015-06-03 3:41 ` Mark yao
0 siblings, 0 replies; 2+ messages in thread
From: Mark yao @ 2015-06-03 3:41 UTC (permalink / raw)
To: Heiko Stübner; +Cc: linux-rockchip, dri-devel
On 2015年06月02日 22:41, Heiko Stübner wrote:
> Add a check for the presence of fb_helper to rockchip_drm_output_poll_changed()
> to only call drm_fb_helper_hotplug_event if there is actually a fb_helper
> available. Without this check I see NULL pointer dereferences when the
> hdmi hotplug irq fires before the fb_helper got initialized.
>
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> ---
> Fix to variant as seen on at least Exynos, Armada and Omap
>
> drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
> index 77d5289..002645b 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
> @@ -162,7 +162,8 @@ static void rockchip_drm_output_poll_changed(struct drm_device *dev)
> struct rockchip_drm_private *private = dev->dev_private;
> struct drm_fb_helper *fb_helper = &private->fbdev_helper;
>
> - drm_fb_helper_hotplug_event(fb_helper);
> + if (fb_helper)
> + drm_fb_helper_hotplug_event(fb_helper);
Thanks for the fix, Applied to my drm-next
> }
>
> static const struct drm_mode_config_funcs rockchip_drm_mode_config_funcs = {
--
Mark Yao
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-06-03 3:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-02 14:41 [PATCH] drm/rockchip: only call drm_fb_helper_hotplug_event if fb_helper present Heiko Stübner
2015-06-03 3:41 ` Mark yao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox