All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: moinejf@free.fr
Cc: dri-devel@lists.freedesktop.org
Subject: re: drm/i2c: tda998x: free the CEC device on encoder_destroy
Date: Fri, 20 Jun 2014 22:19:37 +0300	[thread overview]
Message-ID: <20140620191937.GA19824@mwanda> (raw)

Hello Jean-Francois Moine,

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

The patch fc275a74eb81: "drm/i2c: tda998x: free the CEC device on 
encoder_destroy" from Jan 25, 2014, leads to the following Smatch 
complaint:

drivers/gpu/drm/i2c/tda998x_drv.c:1194 tda998x_encoder_destroy()
	 warn: variable dereferenced before check 'priv->cec' (see line 1189)

drivers/gpu/drm/i2c/tda998x_drv.c
  1188		/* disable all IRQs and free the IRQ handler */
  1189		cec_write(priv, REG_CEC_RXSHPDINTENA, 0);
                          ^^^^
We need priv->cec for this.

  1190		reg_clear(priv, REG_INT_FLAGS_2, INT_FLAGS_2_EDID_BLK_RD);
  1191		if (priv->hdmi->irq)
  1192			free_irq(priv->hdmi->irq, priv);
  1193	
  1194		if (priv->cec)
                    ^^^^^^^^^
So hopefully this new check can be removed?

  1195			i2c_unregister_device(priv->cec);
  1196		kfree(priv);

regards,
dan carpenter

                 reply	other threads:[~2014-06-20 19:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20140620191937.GA19824@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=moinejf@free.fr \
    /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.