Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: hali@codeaurora.org
Cc: linux-arm-msm@vger.kernel.org
Subject: [bug report] drm/msm/dsi: Split PHY drivers to separate files
Date: Mon, 4 Oct 2021 13:37:11 +0300	[thread overview]
Message-ID: <20211004103711.GB25015@kili> (raw)

Hello Hai Li,

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

The patch 5c8290284402: "drm/msm/dsi: Split PHY drivers to separate 
files" from Aug 13, 2015, leads to the following Smatch complaint:

    drivers/gpu/drm/msm/dsi/phy/dsi_phy.c:812 msm_dsi_phy_enable()
    warn: variable dereferenced before check 'phy' (see line 809)

drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
   805  int msm_dsi_phy_enable(struct msm_dsi_phy *phy,
   806                          struct msm_dsi_phy_clk_request *clk_req,
   807                          struct msm_dsi_phy_shared_timings *shared_timings)
   808	{
   809		struct device *dev = &phy->pdev->dev;
                                      ^^^^^^^^^^^^^^
"phy" is deferenced without checking

   810		int ret;
   811	
   812		if (!phy || !phy->cfg->ops.enable)
                     ^^^
Too late.  The fact that no one has complained in six years suggests
that the NULL check can be removed but it wasn't 100% to obvious from
reading the code.

   813			return -EINVAL;
   814	

regards,
dan carpenter

             reply	other threads:[~2021-10-04 10:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-04 10:37 Dan Carpenter [this message]
2021-10-04 23:40 ` [bug report] drm/msm/dsi: Split PHY drivers to separate files Dmitry Baryshkov
     [not found] ` <7e093fca7ca4963fb17be139b3158c46@codeaurora.org>
2021-10-04 23:42   ` Fwd: " jesszhan

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=20211004103711.GB25015@kili \
    --to=dan.carpenter@oracle.com \
    --cc=hali@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.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