|
@@ -651,7 +651,8 @@ static int spidev_release(struct inode *inode, struct file *filp)
|
|
kfree(spidev->rx_buffer);
|
|
kfree(spidev->rx_buffer);
|
|
spidev->rx_buffer = NULL;
|
|
spidev->rx_buffer = NULL;
|
|
|
|
|
|
- spidev->speed_hz = spidev->spi->max_speed_hz;
|
|
|
|
|
|
+ if (spidev->spi)
|
|
|
|
+ spidev->speed_hz = spidev->spi->max_speed_hz;
|
|
|
|
|
|
/* ... after we unbound from the underlying device? */
|
|
/* ... after we unbound from the underlying device? */
|
|
spin_lock_irq(&spidev->spi_lock);
|
|
spin_lock_irq(&spidev->spi_lock);
|