diff options
author | Christoph Hellwig <hch@lst.de> | 2022-02-24 18:55:49 +0100 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2022-03-02 04:21:49 +0100 |
commit | a9a4ea1166d640d1b397f24afc1cd7e96c46cd03 (patch) | |
tree | a0093c22d77f3a86eaf3a0eee6dcfa6c989b622c /drivers/scsi/scsi_lib.c | |
parent | scsi: core: Remove the sense and sense_len fields from struct scsi_request (diff) | |
download | linux-a9a4ea1166d640d1b397f24afc1cd7e96c46cd03.tar.xz linux-a9a4ea1166d640d1b397f24afc1cd7e96c46cd03.zip |
scsi: core: Move the resid_len field from struct scsi_request to struct scsi_cmnd
Prepare for removing the scsi_request structure by moving the resid_len
field to struct scsi_cmnd.
Link: https://lore.kernel.org/r/20220224175552.988286-6-hch@lst.de
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: John Garry <john.garry@huawei.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r-- | drivers/scsi/scsi_lib.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 896b3ecdce8e..a9d8e80032a3 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -251,11 +251,11 @@ int __scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, * is invalid. Prevent the garbage from being misinterpreted * and prevent security leaks by zeroing out the excess data. */ - if (unlikely(rq->resid_len > 0 && rq->resid_len <= bufflen)) - memset(buffer + (bufflen - rq->resid_len), 0, rq->resid_len); + if (unlikely(scmd->resid_len > 0 && scmd->resid_len <= bufflen)) + memset(buffer + bufflen - scmd->resid_len, 0, scmd->resid_len); if (resid) - *resid = rq->resid_len; + *resid = scmd->resid_len; if (sense && scmd->sense_len) memcpy(sense, scmd->sense_buffer, SCSI_SENSE_BUFFERSIZE); if (sshdr) |