Input: bu21013_ts - fix null dereference in error handling
[pandora-kernel.git] / drivers / video / fbmem.c
index 731fce6..b066475 100644 (file)
@@ -1362,6 +1362,7 @@ fb_mmap(struct file *file, struct vm_area_struct * vma)
        vma->vm_pgoff = off >> PAGE_SHIFT;
        /* This is an IO map - tell maydump to skip this VMA */
        vma->vm_flags |= VM_IO | VM_RESERVED;
+       vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
        fb_pgprotect(file, vma, off);
        if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT,
                             vma->vm_end - vma->vm_start, vma->vm_page_prot))
@@ -1786,7 +1787,7 @@ static int ofonly __read_mostly;
 int fb_get_options(char *name, char **option)
 {
        char *opt, *options = NULL;
-       int opt_len, retval = 0;
+       int retval = 0;
        int name_len = strlen(name), i;
 
        if (name_len && ofonly && strncmp(name, "offb", 4))
@@ -1796,8 +1797,7 @@ int fb_get_options(char *name, char **option)
                for (i = 0; i < FB_MAX; i++) {
                        if (video_options[i] == NULL)
                                continue;
-                       opt_len = strlen(video_options[i]);
-                       if (!opt_len)
+                       if (!video_options[i][0])
                                continue;
                        opt = video_options[i];
                        if (!strncmp(name, opt, name_len) &&