Patchwork [1/1,Maverick] UBUNTU: SAUCE: fbcon -- fix OOPs triggered by race prevention fixes

login
register
mail settings
Submitter Andy Whitcroft
Date Sept. 10, 2010, 4:26 p.m.
Message ID <1284136015-4742-1-git-send-email-apw@canonical.com>
Download mbox | patch
Permalink /patch/64414/
State Accepted
Delegated to: Leann Ogasawara
Headers show

Comments

Andy Whitcroft - Sept. 10, 2010, 4:26 p.m.
BugLink: http://bugs.launchpad.net/bugs/614008

The fix below added reference counting to framebuffer opens, it
inadvertantly does not handle the totally missing framebuffer case:

    UBUNTU: SAUCE: fbcon -- fix race between open and removal of framebuffers

lshw tickles this searching for framebuffers leading to an OOPs and boot
hangs for some machines.

Initial-fix-by: Dave Gilbert
Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
 drivers/video/fbmem.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
Leann Ogasawara - Sept. 10, 2010, 5:48 p.m.
Applied to Maverick linux master.

Thanks,
Leann

On Fri, 2010-09-10 at 17:26 +0100, Andy Whitcroft wrote:
> BugLink: http://bugs.launchpad.net/bugs/614008
> 
> The fix below added reference counting to framebuffer opens, it
> inadvertantly does not handle the totally missing framebuffer case:
> 
>     UBUNTU: SAUCE: fbcon -- fix race between open and removal of framebuffers
> 
> lshw tickles this searching for framebuffers leading to an OOPs and boot
> hangs for some machines.
> 
> Initial-fix-by: Dave Gilbert
> Signed-off-by: Andy Whitcroft <apw@canonical.com>
> ---
>  drivers/video/fbmem.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
> index 02eb135..0088013 100644
> --- a/drivers/video/fbmem.c
> +++ b/drivers/video/fbmem.c
> @@ -1407,7 +1407,8 @@ __releases(&registered_lock)
>  
>  	spin_lock(&registered_lock);
>  	fb_info = registered_fb[idx];
> -	fb_info->ref_count++;
> +	if (fb_info)
> +		fb_info->ref_count++;
>  	spin_unlock(&registered_lock);
>  
>  	return fb_info;
> -- 
> 1.7.0.4
> 
>

Patch

diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 02eb135..0088013 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -1407,7 +1407,8 @@  __releases(&registered_lock)
 
 	spin_lock(&registered_lock);
 	fb_info = registered_fb[idx];
-	fb_info->ref_count++;
+	if (fb_info)
+		fb_info->ref_count++;
 	spin_unlock(&registered_lock);
 
 	return fb_info;