Merge ../linus
[powerpc.git] / drivers / video / fbsysfs.c
index 3514703..b72b052 100644 (file)
@@ -43,10 +43,11 @@ struct fb_info *framebuffer_alloc(size_t size, struct device *dev)
        if (size)
                fb_info_size += PADDING;
 
-       p = kmalloc(fb_info_size + size, GFP_KERNEL);
+       p = kzalloc(fb_info_size + size, GFP_KERNEL);
+
        if (!p)
                return NULL;
-       memset(p, 0, fb_info_size + size);
+
        info = (struct fb_info *) p;
 
        if (size)
@@ -347,7 +348,7 @@ static ssize_t store_cmap(struct class_device *class_device, const char *buf,
                fb_copy_cmap(&umap, &fb_info->cmap);
                fb_dealloc_cmap(&umap);
 
-               return rc;
+               return rc ?: count;
        }
        for (i = 0; i < length; i++) {
                u16 red, blue, green, tsp;
@@ -366,7 +367,7 @@ static ssize_t store_cmap(struct class_device *class_device, const char *buf,
                if (transp)
                        fb_info->cmap.transp[i] = tsp;
        }
-       return 0;
+       return count;
 }
 
 static ssize_t show_cmap(struct class_device *class_device, char *buf)