[Stgt-devel] [PATCH] INQUIRY Additional len size incorrectly calculated

Mark Harvey markh794
Sat Dec 8 10:12:21 CET 2007


>From 70246d2420b5ec4180289ae64a1abb92ae3c8e11 Mon Sep 17 00:00:00 2001
From: Mark Harvey <markh794 at gmail.com>
Date: Sat, 8 Dec 2007 19:46:54 +1100
Subject: Incorrect calculation for standard INQUIRY additional len field

Additional len calculated incorrectly due to len not being set
before use.

Signed-off-by: Mark Harvey <markh794 at gmail.com>
---
 usr/spc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/usr/spc.c b/usr/spc.c
index 5b258bd..aa8ff9e 100644
--- a/usr/spc.c
+++ b/usr/spc.c
@@ -182,8 +182,8 @@ int spc_inquiry(int host_no, struct scsi_cmd *cmd)
 		for (i = 0; i < ARRAY_SIZE(attrs->version_desc); i++)
 			*desc++ = __cpu_to_be16(attrs->version_desc[i]);
 
-		data[4] = len - 5;	/* Additional Length */
 		len = 66;
+		data[4] = len - 5;	/* Additional Length */
 		ret = SAM_STAT_GOOD;
 	} else if (scb[1] & 0x2) {
 		/* CmdDt bit is set */
-- 
1.5.2.5







More information about the stgt mailing list