[PATCH] drm: fix case where panic notifier isn't unregistered
Frank Binns
Frank.Binns at imgtec.com
Thu May 24 02:50:44 PDT 2012
Hi,
I don't know if this patch got missed in the list traffic or if I did something wrong but it doesn't appear to have been picked up. This is my first time contributing so if I did anything wrong some pointers would be appreciated.
Thanks
Frank
> From: dri-devel-bounces+frank.binns=imgtec.com at lists.freedesktop.org [mailto:dri-devel-bounces+frank.binns=imgtec.com at lists.freedesktop.org] On Behalf Of Frank Binns
> Sent: 14 May 2012 16:28
> To: 'airlied at linux.ie'; 'dri-devel at lists.freedesktop.org'
> Subject: [PATCH] drm: fix case where panic notifier isn't unregistered
>
> The framebuffer helper panic notifier is unregistered, in drm_fb_helper_fini(), when kernel_fb_helper_list goes from being non-empty to empty. However, in drm_fb_helper_single_fb_probe(), it's possible for the panic notifier to be registered without an element being added to this list if a driver's probe function returns 0. Make sure that an attempt to add the panic notifier is made only when adding an element to kernel_fb_helper_list.
>
> Signed-off-by: Frank Binns <frank.binns at imgtec.com>
> ---
> drivers/gpu/drm/drm_fb_helper.c | 21 ++++++++++-----------
> 1 files changed, 10 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index a0d6e89..d3764b3 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -807,21 +807,20 @@ int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
> printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node,
> info->fix.id);
>
> + /* Switch back to kernel console on panic */
> + /* multi card linked list maybe */
> + if (list_empty(&kernel_fb_helper_list)) {
> + printk(KERN_INFO "drm: registered panic notifier\n");
> + atomic_notifier_chain_register(&panic_notifier_list,
> + &paniced);
> + register_sysrq_key('v', &sysrq_drm_fb_helper_restore_op);
> + }
> +
> + list_add(&fb_helper->kernel_fb_list, &kernel_fb_helper_list);
> } else {
> drm_fb_helper_set_par(info);
> }
>
> - /* Switch back to kernel console on panic */
> - /* multi card linked list maybe */
> - if (list_empty(&kernel_fb_helper_list)) {
> - printk(KERN_INFO "drm: registered panic notifier\n");
> - atomic_notifier_chain_register(&panic_notifier_list,
> - &paniced);
> - register_sysrq_key('v', &sysrq_drm_fb_helper_restore_op);
> - }
> - if (new_fb)
> - list_add(&fb_helper->kernel_fb_list, &kernel_fb_helper_list);
> -
> return 0;
> }
> EXPORT_SYMBOL(drm_fb_helper_single_fb_probe);
> --
> 1.7.5.4
More information about the dri-devel
mailing list