All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org
Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: re: spi: spidev: Don't mangle max_speed_hz in underlying spi device
Date: Tue, 11 Nov 2014 15:42:51 +0300	[thread overview]
Message-ID: <20141111124251.GA15219@mwanda> (raw)

Hello Mark Brown,

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

The patch c4f5669ff40e: "spi: spidev: Don't mangle max_speed_hz i
underlying spi device" from Nov 8, 2014, leads to the following
Smatch complaint:

drivers/spi/spidev.c:581 spidev_release()
	 warn: variable dereferenced before check 'spidev->spi' (see line 577)

drivers/spi/spidev.c
   576
   577			spidev->speed_hz = spidev->spi->max_speed_hz;
                                           ^^^^^^^^^^^^^
New unchecked dereference.

   578
   579			/* ... after we unbound from the underlying device? */
   580			spin_lock_irq(&spidev->spi_lock);
   581			dofree = (spidev->spi == NULL);
                                  ^^^^^^^^^^^^^^^^^^^
Old code assumes ->spi can be NULL.

   582			spin_unlock_irq(&spidev->spi_lock);
   583

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

                 reply	other threads:[~2014-11-11 12:42 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=20141111124251.GA15219@mwanda \
    --to=dan.carpenter-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.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.