Skip to content

Commit

Permalink
Merge branch 'master' into backport_ubuntu_16.04.2_4.4.0-62-generic
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvin-cao committed Mar 23, 2020
2 parents 3d895e4 + 6be06dc commit b9cd8ec
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions switchtec.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ static void mrpc_complete_cmd(struct switchtec_dev *stdev)
stuser_set_state(stuser, MRPC_DONE);
stuser->return_code = 0;

if (stuser->status != SWITCHTEC_MRPC_STATUS_DONE)
if (stuser->status != SWITCHTEC_MRPC_STATUS_DONE &&
stuser->status != SWITCHTEC_MRPC_STATUS_ERROR)
goto out;

if (stdev->dma_mrpc)
Expand Down Expand Up @@ -569,7 +570,8 @@ static ssize_t switchtec_dev_read(struct file *filp, char __user *data,
out:
mutex_unlock(&stdev->mrpc_mutex);

if (stuser->status == SWITCHTEC_MRPC_STATUS_DONE)
if (stuser->status == SWITCHTEC_MRPC_STATUS_DONE ||
stuser->status == SWITCHTEC_MRPC_STATUS_ERROR)
return size;
else if (stuser->status == SWITCHTEC_MRPC_STATUS_INTERRUPTED)
return -ENXIO;
Expand Down

0 comments on commit b9cd8ec

Please sign in to comment.