linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* re: spi: spidev: Don't mangle max_speed_hz in underlying spi device
@ 2014-11-11 12:42 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2014-11-11 12:42 UTC (permalink / raw)
  To: broonie-DgEjT+Ai2ygdnm+yROfE0A; +Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-11-11 12:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-11 12:42 spi: spidev: Don't mangle max_speed_hz in underlying spi device Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).