dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: linus.walleij@linaro.org
Cc: dri-devel@lists.freedesktop.org
Subject: [bug report] drm/mcde: Add new driver for ST-Ericsson MCDE
Date: Wed, 29 May 2019 14:35:16 +0300	[thread overview]
Message-ID: <20190529113516.GH19119@mwanda> (raw)

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
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

             reply	other threads:[~2019-05-29 11:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-29 11:35 Dan Carpenter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-08-31 11:39 [bug report] drm/mcde: Add new driver for ST-Ericsson MCDE Dan Carpenter
2020-09-12 10:29 ` Linus Walleij
2019-05-29 11:32 Dan Carpenter
2019-05-29 14:05 ` Linus Walleij
2019-05-29 11:06 Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190529113516.GH19119@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linus.walleij@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox