diff options
author | Aditya Pakki <pakki001@umn.edu> | 2019-01-05 08:14:41 -0600 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-01-07 11:28:15 +0100 |
commit | c8c2702409430a6a2fd928e857f15773aaafcc99 (patch) | |
tree | 2b442531fd07f3d3e21c20b592c8aaa8b4eec023 /drivers/staging/rts5208 | |
parent | 045ee2d0d0757b02f7a8897c26bed3dc127aa564 (diff) | |
download | blackbird-op-linux-c8c2702409430a6a2fd928e857f15773aaafcc99.tar.gz blackbird-op-linux-c8c2702409430a6a2fd928e857f15773aaafcc99.zip |
Staging: rts5208: Fix error handling on rtsx_send_cmd
In sd_execute_write_data, the rtsx_send_cmd could fail with ETIMEDOUT
or EIO. The fix adds a check to handle these failures.
Signed-off-by: Aditya Pakki <pakki001@umn.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rts5208')
-rw-r--r-- | drivers/staging/rts5208/sd.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c index 2c47ae613ea1..c256a2398651 100644 --- a/drivers/staging/rts5208/sd.c +++ b/drivers/staging/rts5208/sd.c @@ -4437,7 +4437,12 @@ int sd_execute_write_data(struct scsi_cmnd *srb, struct rtsx_chip *chip) rtsx_init_cmd(chip); rtsx_add_cmd(chip, CHECK_REG_CMD, 0xFD30, 0x02, 0x02); - rtsx_send_cmd(chip, SD_CARD, 250); + retval = rtsx_send_cmd(chip, SD_CARD, 250); + if (retval < 0) { + write_err = true; + rtsx_clear_sd_error(chip); + goto sd_execute_write_cmd_failed; + } retval = sd_update_lock_status(chip); if (retval != STATUS_SUCCESS) { |