Skip to content

Commit 99f5d48

Browse files
Krzysztof-Htorvalds
authored andcommitted
matroxfb: fix regression with uninitalized fb_info->mm_lock mutex (second head)
Remove redundant locking by the mm_lock mutex before a second head of matrox framebuffer is registered. This fixes a problem with uninitialized the fb_info->mm_lock mutex introduced by the commit 537a1bf " fbdev: add mutex for fb_mmap locking" Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent d7272e5 commit 99f5d48

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎drivers/video/matrox/matroxfb_crtc2.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,16 +289,18 @@ static int matroxfb_dh_release(struct fb_info* info, int user) {
289289
#undef m2info
290290
}
291291

292+
/*
293+
* This function is called before the register_framebuffer so
294+
* no locking is needed.
295+
*/
292296
static void matroxfb_dh_init_fix(struct matroxfb_dh_fb_info *m2info)
293297
{
294298
struct fb_fix_screeninfo *fix = &m2info->fbcon.fix;
295299

296300
strcpy(fix->id, "MATROX DH");
297301

298-
mutex_lock(&m2info->fbcon.mm_lock);
299302
fix->smem_start = m2info->video.base;
300303
fix->smem_len = m2info->video.len_usable;
301-
mutex_unlock(&m2info->fbcon.mm_lock);
302304
fix->ypanstep = 1;
303305
fix->ywrapstep = 0;
304306
fix->xpanstep = 8; /* TBD */

0 commit comments

Comments
 (0)