aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spidev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/spi/spidev.c')
-rw-r--r--drivers/spi/spidev.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index 89a43755a453..5d869c4d3eb2 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -597,7 +597,9 @@ static int spidev_probe(struct spi_device *spi)
597 } 597 }
598 mutex_unlock(&device_list_lock); 598 mutex_unlock(&device_list_lock);
599 599
600 if (status != 0) 600 if (status == 0)
601 spi_set_drvdata(spi, spidev);
602 else
601 kfree(spidev); 603 kfree(spidev);
602 604
603 return status; 605 return status;