mfd: qnap-mcu: handle errors returned from qnap_mcu_write

A patch from »mfd: qnap-mcu: Some fixes / improvements« in state Mainline for linux-kernel

From: Heiko Stuebner <heiko@...> Date: Sat, 26 Jul 2025 23:32:37 +0200

Commit-Message

qnap_mcu_write can return errors and those were not checked before. So do that now. Signed-off-by: Heiko Stuebner <heiko@...>

Patch-Comment

drivers/mfd/qnap-mcu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)

Statistics

  • 5 lines added
  • 1 lines removed

Changes

---------------------------- drivers/mfd/qnap-mcu.c ----------------------------
index e340e9337b98..6448237c4c35 100644
@@ -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));
 
 

Recent Patches

About Us

Sed lacus. Donec lectus. Nullam pretium nibh ut turpis. Nam bibendum. In nulla tortor, elementum vel, tempor at, varius non, purus. Mauris vitae nisl nec metus placerat consectetuer.

Read More...