diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/mx3fb.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c index bd768588cf10..e3406ab31305 100644 --- a/drivers/video/mx3fb.c +++ b/drivers/video/mx3fb.c | |||
@@ -382,6 +382,9 @@ static void sdc_disable_channel(struct mx3fb_info *mx3_fbi) | |||
382 | uint32_t enabled; | 382 | uint32_t enabled; |
383 | unsigned long flags; | 383 | unsigned long flags; |
384 | 384 | ||
385 | if (mx3_fbi->txd == NULL) | ||
386 | return; | ||
387 | |||
385 | spin_lock_irqsave(&mx3fb->lock, flags); | 388 | spin_lock_irqsave(&mx3fb->lock, flags); |
386 | 389 | ||
387 | enabled = sdc_fb_uninit(mx3_fbi); | 390 | enabled = sdc_fb_uninit(mx3_fbi); |
@@ -986,9 +989,19 @@ static void __blank(int blank, struct fb_info *fbi) | |||
986 | { | 989 | { |
987 | struct mx3fb_info *mx3_fbi = fbi->par; | 990 | struct mx3fb_info *mx3_fbi = fbi->par; |
988 | struct mx3fb_data *mx3fb = mx3_fbi->mx3fb; | 991 | struct mx3fb_data *mx3fb = mx3_fbi->mx3fb; |
992 | int was_blank = mx3_fbi->blank; | ||
989 | 993 | ||
990 | mx3_fbi->blank = blank; | 994 | mx3_fbi->blank = blank; |
991 | 995 | ||
996 | /* Attention! | ||
997 | * Do not call sdc_disable_channel() for a channel that is disabled | ||
998 | * already! This will result in a kernel NULL pointer dereference | ||
999 | * (mx3_fbi->txd is NULL). Hide the fact, that all blank modes are | ||
1000 | * handled equally by this driver. | ||
1001 | */ | ||
1002 | if (blank > FB_BLANK_UNBLANK && was_blank > FB_BLANK_UNBLANK) | ||
1003 | return; | ||
1004 | |||
992 | switch (blank) { | 1005 | switch (blank) { |
993 | case FB_BLANK_POWERDOWN: | 1006 | case FB_BLANK_POWERDOWN: |
994 | case FB_BLANK_VSYNC_SUSPEND: | 1007 | case FB_BLANK_VSYNC_SUSPEND: |