projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'upstream-fixes' into upstream
[powerpc.git]
/
drivers
/
video
/
fbmem.c
diff --git
a/drivers/video/fbmem.c
b/drivers/video/fbmem.c
index
b1a8dca
..
372aa17
100644
(file)
--- a/
drivers/video/fbmem.c
+++ b/
drivers/video/fbmem.c
@@
-435,6
+435,11
@@
int fb_prepare_logo(struct fb_info *info, int rotate)
depth = info->var.green.length;
}
depth = info->var.green.length;
}
+ if (info->fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR) {
+ /* assume console colormap */
+ depth = 4;
+ }
+
if (depth >= 8) {
switch (info->fix.visual) {
case FB_VISUAL_TRUECOLOR:
if (depth >= 8) {
switch (info->fix.visual) {
case FB_VISUAL_TRUECOLOR:
@@
-669,13
+674,19
@@
fb_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
total_size = info->fix.smem_len;
if (p > total_size)
total_size = info->fix.smem_len;
if (p > total_size)
- return
0
;
+ return
-EFBIG
;
- if (count >= total_size)
+ if (count > total_size) {
+ err = -EFBIG;
count = total_size;
count = total_size;
+ }
+
+ if (count + p > total_size) {
+ if (!err)
+ err = -ENOSPC;
- if (count + p > total_size)
count = total_size - p;
count = total_size - p;
+ }
buffer = kmalloc((count > PAGE_SIZE) ? PAGE_SIZE : count,
GFP_KERNEL);
buffer = kmalloc((count > PAGE_SIZE) ? PAGE_SIZE : count,
GFP_KERNEL);
@@
-717,7
+728,7
@@
fb_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
kfree(buffer);
kfree(buffer);
- return (
err) ? err : cnt
;
+ return (
cnt) ? cnt : err
;
}
#ifdef CONFIG_KMOD
}
#ifdef CONFIG_KMOD
@@
-1588,7
+1599,7
@@
static int __init video_setup(char *options)
}
}
}
}
- return
0
;
+ return
1
;
}
__setup("video=", video_setup);
#endif
}
__setup("video=", video_setup);
#endif