diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2019-04-29 15:26:30 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-04-29 15:25:12 +0300 |
commit | c2d1812600f5a8c9341b2db7c863cd2725444de5 (patch) | |
tree | 82eafd1d111fa3dd80be9b4f6b1deecbfa081a07 /drivers/usb | |
parent | 5f2c54e7153f2b30b7ee5c65ec5eb2b38a7b962d (diff) | |
download | linux-c2d1812600f5a8c9341b2db7c863cd2725444de5.tar.xz |
usb: typec: ucsi: ccg: fix missing unlock on error in ccg_cmd_write_flash_row()
Add the missing unlock before return from function ccg_cmd_write_flash_row()
in the error handling case.
Fixes: 5c9ae5a87573 ("usb: typec: ucsi: ccg: add firmware flashing support")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/typec/ucsi/ucsi_ccg.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c index 4632b91a04a6..9d46aa9e4e35 100644 --- a/drivers/usb/typec/ucsi/ucsi_ccg.c +++ b/drivers/usb/typec/ucsi/ucsi_ccg.c @@ -631,6 +631,7 @@ ccg_cmd_write_flash_row(struct ucsi_ccg *uc, u16 row, ret = i2c_master_send(client, buf, CCG4_ROW_SIZE + 2); if (ret != CCG4_ROW_SIZE + 2) { dev_err(uc->dev, "REG_FLASH_RW_MEM write fail %d\n", ret); + mutex_unlock(&uc->lock); return ret < 0 ? ret : -EIO; } |