2008-03-21 22:46:31

by Chris Wright

[permalink] [raw]
Subject: [patch 27/76] SCSI ips: fix data buffer accessors conversion bug

-stable review patch. If anyone has any objections, please let us know.
---------------------

From: FUJITA Tomonori <[email protected]>

This fixes a bug that can't handle a passthru command with more than
two sg entries.

Big thanks to Tim Pepper for debugging the problem.

Signed-off-by: FUJITA Tomonori <[email protected]>
Acked-by: Mark Salyzyn <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
Signed-off-by: Chris Wright <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/scsi/ips.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/scsi/ips.c
+++ b/drivers/scsi/ips.c
@@ -1580,7 +1580,7 @@ ips_make_passthru(ips_ha_t *ha, struct s
METHOD_TRACE("ips_make_passthru", 1);

scsi_for_each_sg(SC, sg, scsi_sg_count(SC), i)
- length += sg[i].length;
+ length += sg->length;

if (length < sizeof (ips_passthru_t)) {
/* wrong size */

--