diff options
-rw-r--r-- | drivers/spi/spi-loopback-test.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/spi/spi-loopback-test.c b/drivers/spi/spi-loopback-test.c index 514997a143dc..3459965004f8 100644 --- a/drivers/spi/spi-loopback-test.c +++ b/drivers/spi/spi-loopback-test.c | |||
@@ -1021,10 +1021,9 @@ int spi_test_run_tests(struct spi_device *spi, | |||
1021 | rx = vmalloc(SPI_TEST_MAX_SIZE_PLUS); | 1021 | rx = vmalloc(SPI_TEST_MAX_SIZE_PLUS); |
1022 | else | 1022 | else |
1023 | rx = kzalloc(SPI_TEST_MAX_SIZE_PLUS, GFP_KERNEL); | 1023 | rx = kzalloc(SPI_TEST_MAX_SIZE_PLUS, GFP_KERNEL); |
1024 | if (!rx) { | 1024 | if (!rx) |
1025 | ret = -ENOMEM; | 1025 | return -ENOMEM; |
1026 | goto out; | 1026 | |
1027 | } | ||
1028 | 1027 | ||
1029 | if (use_vmalloc) | 1028 | if (use_vmalloc) |
1030 | tx = vmalloc(SPI_TEST_MAX_SIZE_PLUS); | 1029 | tx = vmalloc(SPI_TEST_MAX_SIZE_PLUS); |
@@ -1032,7 +1031,7 @@ int spi_test_run_tests(struct spi_device *spi, | |||
1032 | tx = kzalloc(SPI_TEST_MAX_SIZE_PLUS, GFP_KERNEL); | 1031 | tx = kzalloc(SPI_TEST_MAX_SIZE_PLUS, GFP_KERNEL); |
1033 | if (!tx) { | 1032 | if (!tx) { |
1034 | ret = -ENOMEM; | 1033 | ret = -ENOMEM; |
1035 | goto out; | 1034 | goto err_tx; |
1036 | } | 1035 | } |
1037 | 1036 | ||
1038 | /* now run the individual tests in the table */ | 1037 | /* now run the individual tests in the table */ |
@@ -1057,8 +1056,9 @@ int spi_test_run_tests(struct spi_device *spi, | |||
1057 | } | 1056 | } |
1058 | 1057 | ||
1059 | out: | 1058 | out: |
1060 | kvfree(rx); | ||
1061 | kvfree(tx); | 1059 | kvfree(tx); |
1060 | err_tx: | ||
1061 | kvfree(rx); | ||
1062 | return ret; | 1062 | return ret; |
1063 | } | 1063 | } |
1064 | EXPORT_SYMBOL_GPL(spi_test_run_tests); | 1064 | EXPORT_SYMBOL_GPL(spi_test_run_tests); |