All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean-Francois Moine <moinejf@free.fr>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: drm/i2c: tda998x: use irq for connection status and EDID read
Date: Mon, 7 Jul 2014 17:54:44 +0200	[thread overview]
Message-ID: <20140707175444.001602a6@armhf> (raw)
In-Reply-To: <20140707142203.GA13469@mwanda>

On Mon, 7 Jul 2014 17:22:03 +0300
Dan Carpenter <dan.carpenter@oracle.com> wrote:

> The patch 12473b7d8e60: "drm/i2c: tda998x: use irq for connection
> status and EDID read" from Jan 25, 2014, leads to the following
> static checker warning:
> 
> 	drivers/gpu/drm/i2c/tda998x_drv.c:1199 tda998x_encoder_destroy()
> 	warn: variable dereferenced before check 'priv->cec' (see line 1194)
> 
> drivers/gpu/drm/i2c/tda998x_drv.c
>   1188  static void
>   1189  tda998x_encoder_destroy(struct drm_encoder *encoder)
>   1190  {
>   1191          struct tda998x_priv *priv = to_tda998x_priv(encoder);
>   1192  
>   1193          /* disable all IRQs and free the IRQ handler */
>   1194          cec_write(priv, REG_CEC_RXSHPDINTENA, 0);
>                 ^^^^^^^^^^^^^^
> We dereference priv->cec inside the call to cec_write().
> 
>   1195          reg_clear(priv, REG_INT_FLAGS_2, INT_FLAGS_2_EDID_BLK_RD);
>   1196          if (priv->hdmi->irq)
>   1197                  free_irq(priv->hdmi->irq, priv);
>   1198  
>   1199          if (priv->cec)
>                     ^^^^^^^^^
> But later in the function we assume that ->cec can be NULL.
> 
>   1200                  i2c_unregister_device(priv->cec);
>   1201          drm_i2c_encoder_destroy(encoder);
>   1202          kfree(priv);
>   1203  }

Yes, priv->cec is never NULL.

Thanks.

-- 
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2014-07-07 15:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-07 14:22 drm/i2c: tda998x: use irq for connection status and EDID read Dan Carpenter
2014-07-07 15:54 ` Jean-Francois Moine [this message]

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=20140707175444.001602a6@armhf \
    --to=moinejf@free.fr \
    --cc=dan.carpenter@oracle.com \
    --cc=dri-devel@lists.freedesktop.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.