Skip to content

Commit

Permalink
usb: typec: ucsi: ccg: fix missing unlock on error in ccg_cmd_write_f…
Browse files Browse the repository at this point in the history
…lash_row()

Add the missing unlock before return from function ccg_cmd_write_flash_row()
in the error handling case.

Fixes: 5c9ae5a ("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>
  • Loading branch information
Wei Yongjun authored and Greg Kroah-Hartman committed Apr 29, 2019
1 parent 5f2c54e commit c2d1812
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/usb/typec/ucsi/ucsi_ccg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit c2d1812

Please sign in to comment.