From f771f92514f614bce18c5f527187a184d7d68acb Mon Sep 17 00:00:00 2001 From: hgchu Date: Fri, 12 Jan 2018 13:06:10 +0900 Subject: [PATCH] scsi: ufs: clean-up remained cmd on abort-handling Change-Id: Iee3000f142cd9ef969f351c22810d7f17724c29f Signed-off-by: hgchu --- drivers/scsi/ufs/ufshcd.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 5122b6bd95ff..54fe87af197b 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -5816,6 +5816,7 @@ static int ufshcd_abort(struct scsi_cmnd *cmd) dev_err(hba->dev, "%s: cmd was completed, but without a notifying intr, tag = %d", __func__, tag); + goto clean; } /* Print Transfer Request of aborted task */ @@ -5876,12 +5877,18 @@ static int ufshcd_abort(struct scsi_cmnd *cmd) __func__, tag, err); if (!err) err = resp; /* service response error */ + dev_err(hba->dev, + "%s: query task failed with err %d\n", + __func__, err); goto out; } } if (!poll_cnt) { err = -EBUSY; + dev_err(hba->dev, + "%s: cmd might be missed, not pending in device\n", + __func__); goto out; } @@ -5902,7 +5909,7 @@ static int ufshcd_abort(struct scsi_cmnd *cmd) __func__, tag, err); goto out; } - +clean: scsi_dma_unmap(cmd); spin_lock_irqsave(host->host_lock, flags); -- 2.20.1