lkml.org 
[lkml]   [2008]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Linux-fbdev-devel] [PATCH] fb: Remove use of lock_kernel / unlock_kernel in fbmem
On Wed, 16 Apr 2008 20:00:59 -0300
Thiago Galesi <thiagogalesi@gmail.com> wrote:

>
> This patch removes lock_kernel(), unlock_kernel() usage in fbmem.c and replaces it with a mutex
>
> Signed-off-by: Thiago Galesi <thiagogalesi@gmail.com>
>
[...]
> @@ -1413,6 +1435,8 @@ register_framebuffer(struct fb_info *fb_
>
> event.info = fb_info;
> fb_notifier_call_chain(FB_EVENT_FB_REGISTERED, &event);
> +
> + mutex_init(&fb_info->hwlock);
> return 0;
> }
>

Just a minor nit; in general, I'd think you would want to completely
initialize the structure (including calling mutex_init) before
registering the structure with the rest of the system (in this case,
with registered_fb and *_call_notifier_chain). Initializing after
registration is just asking for a race conditions.



--
Need a kernel or Debian developer? Contact me, I'm looking for contracts.


\
 
 \ /
  Last update: 2008-04-18 19:41    [W:0.055 / U:0.888 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site