[bug report] drm/mcde: Add new driver for ST-Ericsson MCDE

Dan Carpenter dan.carpenter at oracle.com
Wed May 29 11:35:16 UTC 2019


Hello Linus Walleij,

This is a semi-automatic email about new static checker warnings.

The patch 5fc537bfd000: "drm/mcde: Add new driver for ST-Ericsson 
MCDE" from May 24, 2019, leads to the following Smatch complaint:

    drivers/gpu/drm/mcde/mcde_dsi.c:908 mcde_dsi_bind()
    error: we previously assumed 'd->mdsi' could be null (see line 879)

drivers/gpu/drm/mcde/mcde_dsi.c
   878		/* If the display attached before binding, set this up */
   879		if (d->mdsi)
                    ^^^^^^^
Check for NULL

   880			d->mcde->mdsi = d->mdsi;
   881	
   882		/* Obtain the clocks */
   883		d->hs_clk = devm_clk_get(dev, "hs");
   884		if (IS_ERR(d->hs_clk)) {
   885			dev_err(dev, "unable to get HS clock\n");
   886			return PTR_ERR(d->hs_clk);
   887		}
   888	
   889		d->lp_clk = devm_clk_get(dev, "lp");
   890		if (IS_ERR(d->lp_clk)) {
   891			dev_err(dev, "unable to get LP clock\n");
   892			return PTR_ERR(d->lp_clk);
   893		}
   894	
   895		/* Assert RESET through the PRCMU, active low */
   896		/* FIXME: which DSI block? */
   897		regmap_update_bits(d->prcmu, PRCM_DSI_SW_RESET,
   898				   PRCM_DSI_SW_RESET_DSI0_SW_RESETN, 0);
   899	
   900		usleep_range(100, 200);
   901	
   902		/* De-assert RESET again */
   903		regmap_update_bits(d->prcmu, PRCM_DSI_SW_RESET,
   904				   PRCM_DSI_SW_RESET_DSI0_SW_RESETN,
   905				   PRCM_DSI_SW_RESET_DSI0_SW_RESETN);
   906	
   907		/* Start up the hardware */
   908		mcde_dsi_start(d);
                               ^
d->mdsi is dereferenced without checking for NULL inside here.

   909	
   910		/* Look for a panel as a child to this node */

regards,
dan carpenter


More information about the dri-devel mailing list