aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/qnap-mcu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mfd/qnap-mcu.c')
-rw-r--r--drivers/mfd/qnap-mcu.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/mfd/qnap-mcu.c b/drivers/mfd/qnap-mcu.c
index 89a8a1913d42..9d3edc3e7d93 100644
--- a/drivers/mfd/qnap-mcu.c
+++ b/drivers/mfd/qnap-mcu.c
@@ -163,7 +163,11 @@ int qnap_mcu_exec(struct qnap_mcu *mcu,
reply->received = 0;
reinit_completion(&reply->done);
- qnap_mcu_write(mcu, cmd_data, cmd_data_size);
+ ret = qnap_mcu_write(mcu, cmd_data, cmd_data_size);
+ if (ret < 0) {
+ mutex_unlock(&mcu->bus_lock);
+ return ret;
+ }
serdev_device_wait_until_sent(mcu->serdev, msecs_to_jiffies(QNAP_MCU_TIMEOUT_MS));