re: spi: spidev: Don't mangle max_speed_hz in underlying spi device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux