diff options
| author | Bob Peterson <rpeterso@redhat.com> | 2018-01-19 00:17:13 +0300 |
|---|---|---|
| committer | Bob Peterson <rpeterso@redhat.com> | 2018-01-19 00:17:13 +0300 |
| commit | 786ebd9f68cdf512f389e5f2d0015f1beb0777d8 (patch) | |
| tree | b4bae82884c2232f891aec11e58b38eb4fec5e5d /drivers/scsi/libsas/sas_expander.c | |
| parent | 1f23bc7869fffec40b8bd9333a74a18d1de54d98 (diff) | |
| parent | 4e56a6411fbce6f859566e17298114c2434391a4 (diff) | |
| download | linux-786ebd9f68cdf512f389e5f2d0015f1beb0777d8.tar.xz | |
Merge branch 'punch-hole' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git
Diffstat (limited to 'drivers/scsi/libsas/sas_expander.c')
| -rw-r--r-- | drivers/scsi/libsas/sas_expander.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index ca1566237ae7..3183d63de4da 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c @@ -2145,7 +2145,7 @@ void sas_smp_handler(struct bsg_job *job, struct Scsi_Host *shost, struct sas_rphy *rphy) { struct domain_device *dev; - unsigned int reslen = 0; + unsigned int rcvlen = 0; int ret = -EINVAL; /* no rphy means no smp target support (ie aic94xx host) */ @@ -2179,12 +2179,12 @@ void sas_smp_handler(struct bsg_job *job, struct Scsi_Host *shost, ret = smp_execute_task_sg(dev, job->request_payload.sg_list, job->reply_payload.sg_list); - if (ret > 0) { - /* positive number is the untransferred residual */ - reslen = ret; + if (ret >= 0) { + /* bsg_job_done() requires the length received */ + rcvlen = job->reply_payload.payload_len - ret; ret = 0; } out: - bsg_job_done(job, ret, reslen); + bsg_job_done(job, ret, rcvlen); } |
