dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: paul@crapouillou.net
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [bug report] drm/ingenic: Add support for the IPU
Date: Mon, 20 Jul 2020 10:24:44 +0300	[thread overview]
Message-ID: <20200720072444.GI2571@kadam> (raw)
In-Reply-To: <20200720072237.GA8232@mwanda>

On Mon, Jul 20, 2020 at 10:22:37AM +0300, dan.carpenter@oracle.com wrote:
> Hello Paul Cercueil,
> 
> The patch fc1acf317b01: "drm/ingenic: Add support for the IPU" from
> Jul 16, 2020, leads to the following static checker warning:
> 
> 	drivers/gpu/drm/ingenic/ingenic-drm-drv.c:232 ingenic_drm_crtc_atomic_check()
> 	error: potentially dereferencing uninitialized 'ipu_state'.
> 
> drivers/gpu/drm/ingenic/ingenic-drm-drv.c
>    197  static int ingenic_drm_crtc_atomic_check(struct drm_crtc *crtc,
>    198                                           struct drm_crtc_state *state)
>    199  {
>    200          struct ingenic_drm *priv = drm_crtc_get_priv(crtc);
>    201          struct drm_plane_state *f1_state, *f0_state, *ipu_state;
>    202          long rate;
>    203  
>    204          if (!drm_atomic_crtc_needs_modeset(state))
>    205                  return 0;
>    206  
>    207          if (state->mode.hdisplay > priv->soc_info->max_width ||
>    208              state->mode.vdisplay > priv->soc_info->max_height)
>    209                  return -EINVAL;
>    210  
>    211          rate = clk_round_rate(priv->pix_clk,
>    212                                state->adjusted_mode.clock * 1000);
>    213          if (rate < 0)
>    214                  return rate;
>    215  
>    216          if (priv->soc_info->has_osd) {
>    217                  f1_state = drm_atomic_get_plane_state(state->state, &priv->f1);
>    218                  f0_state = drm_atomic_get_plane_state(state->state, &priv->f0);

drivers/gpu/drm/ingenic/ingenic-drm-drv.c:224 ingenic_drm_crtc_atomic_check() error: 'f1_state' dereferencing possible ERR_PTR()
drivers/gpu/drm/ingenic/ingenic-drm-drv.c:224 ingenic_drm_crtc_atomic_check() error: 'ipu_state' dereferencing possible ERR_PTR()
drivers/gpu/drm/ingenic/ingenic-drm-drv.c:231 ingenic_drm_crtc_atomic_check() error: 'f1_state' dereferencing possible ERR_PTR()
drivers/gpu/drm/ingenic/ingenic-drm-drv.c:231 ingenic_drm_crtc_atomic_check() error: 'f0_state' dereferencing possible ERR_PTR()
drivers/gpu/drm/ingenic/ingenic-drm-drv.c:232 ingenic_drm_crtc_atomic_check() error: 'ipu_state' dereferencing possible ERR_PTR()

Also Smatch complains that these need error checking.

regards,
dan carpenter

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-07-20  7:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-20  7:22 [bug report] drm/ingenic: Add support for the IPU dan.carpenter
2020-07-20  7:24 ` Dan Carpenter [this message]
2020-07-20  7:44 ` Daniel Vetter
2020-07-20 10:27 ` Paul Cercueil

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=20200720072444.GI2571@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=paul@crapouillou.net \
    /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