aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ps3rom.c
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2008-02-25 08:23:45 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-03-03 14:06:37 -0500
commit67768f675ffa587d6081ed1d259e796823023926 (patch)
tree5b414048a5a236194ce196e50b3a0a5049ebc83b /drivers/scsi/ps3rom.c
parent00da714b31b944400ee789e477f58247cff30b1b (diff)
[SCSI] ps3rom: fix wrong resid calculation bug
sg driver rounds up the length in struct scatterlist to be a multiple of 512 in some conditions. So LLDs can't use the data length in a sg list to calculate residual. Instead, the length in struct scsi_cmnd should be used. [Geert: the variable buflen already contains scsi_bufflen(cmd)] Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/ps3rom.c')
-rw-r--r--drivers/scsi/ps3rom.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/ps3rom.c b/drivers/scsi/ps3rom.c
index 0cd614a0fa73..e052c8479d51 100644
--- a/drivers/scsi/ps3rom.c
+++ b/drivers/scsi/ps3rom.c
@@ -124,7 +124,7 @@ static int fill_from_dev_buffer(struct scsi_cmnd *cmd, const void *buf)
124 } 124 }
125 req_len += sgpnt->length; 125 req_len += sgpnt->length;
126 } 126 }
127 scsi_set_resid(cmd, req_len - act_len); 127 scsi_set_resid(cmd, buflen - act_len);
128 return 0; 128 return 0;
129} 129}
130 130