fbdev: add mutex for fb_mmap locking
[safe/jmp/linux-2.6] / drivers / video / atmel_lcdfb.c
index 5afd644..cb88394 100644 (file)
@@ -270,7 +270,9 @@ static int atmel_lcdfb_alloc_video_memory(struct atmel_lcdfb_info *sinfo)
 
        smem_len = (var->xres_virtual * var->yres_virtual
                    * ((var->bits_per_pixel + 7) / 8));
+       mutex_lock(&info->mm_lock);
        info->fix.smem_len = max(smem_len, sinfo->smem_len);
+       mutex_unlock(&info->mm_lock);
 
        info->screen_base = dma_alloc_writecombine(info->device, info->fix.smem_len,
                                        (dma_addr_t *)&info->fix.smem_start, GFP_KERNEL);