diff --git a/arch/sandbox/include/asm/sdl.h b/arch/sandbox/include/asm/sdl.h index e271a849af..56dcb84803 100644 --- a/arch/sandbox/include/asm/sdl.h +++ b/arch/sandbox/include/asm/sdl.h @@ -94,6 +94,11 @@ static inline int sandbox_sdl_init_display(int width, int height, int log2_bpp, return -ENODEV; } +static inline int sandbox_sdl_remove_display(void) +{ + return -ENODEV; +} + static inline int sandbox_sdl_sync(void *lcd_base) { return -ENODEV; diff --git a/drivers/video/stb_truetype.h b/drivers/video/stb_truetype.h index 26f4ac2ca8..438bfce468 100644 --- a/drivers/video/stb_truetype.h +++ b/drivers/video/stb_truetype.h @@ -1768,10 +1768,13 @@ static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e, int s; // vertical subsample index unsigned char scanline_data[512], *scanline; - if (result->w > 512) + if (result->w > 512) { scanline = (unsigned char *) STBTT_malloc(result->w, userdata); - else + if (!scanline) + return; + } else { scanline = scanline_data; + } y = off_y * vsubsample; e[n].y0 = (off_y + result->h) * (float) vsubsample + 1; @@ -1821,6 +1824,8 @@ static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e, while (e->y0 <= scan_y) { if (e->y1 > scan_y) { stbtt__active_edge *z = stbtt__new_active(&hh, e, off_x, scan_y, userdata); + if (!z) + return; // find insertion point if (active == NULL) active = z; @@ -2068,10 +2073,13 @@ static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e, int y,j=0, i; float scanline_data[129], *scanline, *scanline2; - if (result->w > 64) + if (result->w > 64) { scanline = (float *) STBTT_malloc((result->w*2+1) * sizeof(float), userdata); - else + if (!scanline) + return; + } else { scanline = scanline_data; + } scanline2 = scanline + result->w; @@ -2105,6 +2113,8 @@ static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e, while (e->y0 <= scan_y_bottom) { if (e->y0 != e->y1) { stbtt__active_edge *z = stbtt__new_active(&hh, e, off_x, scan_y_top, userdata); + if (!z) + return; STBTT_assert(z->ey >= scan_y_top); // insert at front z->next = active; diff --git a/drivers/video/stm32/stm32_dsi.c b/drivers/video/stm32/stm32_dsi.c index 134abd93e1..5871ac7c4f 100644 --- a/drivers/video/stm32/stm32_dsi.c +++ b/drivers/video/stm32/stm32_dsi.c @@ -433,19 +433,17 @@ static int stm32_dsi_probe(struct udevice *dev) return -EINVAL; } - if (IS_ENABLED(CONFIG_DM_REGULATOR)) { - ret = device_get_supply_regulator(dev, "phy-dsi-supply", - &priv->vdd_reg); - if (ret && ret != -ENOENT) { - dev_err(dev, "Warning: cannot get phy dsi supply\n"); - return -ENODEV; - } + ret = device_get_supply_regulator(dev, "phy-dsi-supply", + &priv->vdd_reg); + if (ret && ret != -ENOENT) { + dev_err(dev, "Warning: cannot get phy dsi supply\n"); + return -ENODEV; + } - if (ret != -ENOENT) { - ret = regulator_set_enable(priv->vdd_reg, true); - if (ret) - return ret; - } + if (ret != -ENOENT) { + ret = regulator_set_enable(priv->vdd_reg, true); + if (ret) + return ret; } ret = clk_get_by_name(device->dev, "pclk", &clk); @@ -493,8 +491,7 @@ static int stm32_dsi_probe(struct udevice *dev) err_clk: clk_disable(&clk); err_reg: - if (IS_ENABLED(CONFIG_DM_REGULATOR)) - regulator_set_enable(priv->vdd_reg, false); + regulator_set_enable(priv->vdd_reg, false); return ret; }