diff options
Diffstat (limited to 'drivers/mfd/glamo/glamo-fb.c')
-rw-r--r-- | drivers/mfd/glamo/glamo-fb.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mfd/glamo/glamo-fb.c b/drivers/mfd/glamo/glamo-fb.c index 44ab9a39787..06bbe8a505f 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, |