s5pc110: fb: possible memory leak (un-free'd malloc)
[kernel/u-boot.git] / drivers / video / s5p-fb.c
index 55bec6e..3e90e21 100644 (file)
@@ -203,7 +203,6 @@ static void draw_samsung_logo(void* lcdbase)
        unsigned int in_len, width, height;
        unsigned long out_len;
        void *dst = NULL;
-
        width = 298;
        height = 78;
        x = ((panel_width - width) >> 1);
@@ -223,6 +222,7 @@ static void draw_samsung_logo(void* lcdbase)
                printf("Image could be truncated"
                                " (increase CONFIG_SYS_VIDEO_LOGO_MAX_SIZE)!\n");
        _draw_samsung_logo(lcdbase, x, y, width, height, (unsigned short *) dst);
+       free(dst);
 }
 
 static void lcd_panel_on(vidinfo_t *vid)
@@ -232,38 +232,40 @@ static void lcd_panel_on(vidinfo_t *vid)
        if (vid->cfg_gpio)
                vid->cfg_gpio();
 
-       if (vid->lcd_power_on) {
+       if (vid->lcd_power_on)
                vid->lcd_power_on(1);
-       }
 
        udelay(vid->power_on_delay);
 
-       if (vid->reset_lcd) {
+       if (vid->reset_lcd)
                vid->reset_lcd();
-       }
 
        udelay(vid->reset_delay);
 
-       if (vid->backlight_on) {
+       if (vid->backlight_on)
                vid->backlight_on(1);
-       }
 
-       if (vid->cfg_ldo) {
+
+       if (vid->cfg_ldo)
                vid->cfg_ldo();
-       }
 
-       if (vid->enable_ldo) {
+
+       if (vid->enable_ldo)
                vid->enable_ldo(1);
-       }
+
 }
 
 /* extern void init_onenand_ext2(void); */
 extern void init_panel_info(vidinfo_t *vid);
+extern int s5p_no_lcd_support(void);
 
 void lcd_ctrl_init(void *lcdbase)
 {
        char *option;
 
+       if (s5p_no_lcd_support())
+               return;
+
        s5pc_lcd_init_mem(lcdbase, &panel_info);
 
        /* initialize parameters which is specific to panel. */