aboutsummaryrefslogtreecommitdiff
path: root/drivers/mfd/glamo/glamo-fb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mfd/glamo/glamo-fb.c')
-rw-r--r--drivers/mfd/glamo/glamo-fb.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mfd/glamo/glamo-fb.c b/drivers/mfd/glamo/glamo-fb.c
index 21165d97fb2..f2f92bcfe66 100644
--- a/drivers/mfd/glamo/glamo-fb.c
+++ b/drivers/mfd/glamo/glamo-fb.c
@@ -734,6 +734,12 @@ static int glamofb_cursor(struct fb_info *info, struct fb_cursor *cursor)
struct glamofb_handle *glamo = info->par;
unsigned long flags;
+ /* Reject if the cursor is too big to fit in the memory allocated in
+ * glamo-core.h */
+
+ if ((cursor->image.width * cursor->image.height) > GLAMO_CURSOR_SIZE )
+ return -EINVAL;
+
spin_lock_irqsave(&glamo->lock_cmd, flags);
reg_write(glamo, GLAMO_REG_LCD_CURSOR_X_SIZE,