stm32: fixed spi shared_mem_release bug

If shared_mem_acquire() failed, we should not call shared_mem_release().

BRANCH=none
BUG=chrome-os-partner:34703
TEST="Compiled"

Change-Id: I5179f8b75b13451a63eb3209c9156066231aa12d
Signed-off-by: Sheng-Liang Song <ssl@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/236392
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Reviewed-by: Alexandru Stan <amstan@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
Sheng-Liang Song
2014-12-17 10:41:52 -08:00
committed by chrome-internal-fetch
parent 2d25b40b75
commit 005fa5fea1

View File

@@ -166,7 +166,7 @@ int spi_transaction_async(const uint8_t *txdata, int txlen,
rv = shared_mem_acquire(MAX(txlen, rxlen), &buf);
if (rv != EC_SUCCESS)
goto err_free;
return rv;
/* Drive SS low */
gpio_set_level(CONFIG_SPI_CS_GPIO, 0);