Fixed case, when resid == cmd->resp_data_len for real devices

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@100 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2007-03-02 15:06:55 +00:00
parent e94515231d
commit 5b4909133d
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -132,7 +132,7 @@ void scst_set_resp_data_len(struct scst_cmd *cmd, int resp_data_len)
cmd->orig_sg_cnt = cmd->sg_cnt;
cmd->orig_sg_entry = i;
cmd->orig_entry_len = cmd->sg[i].length;
cmd->sg_cnt = i+1;
cmd->sg_cnt = (left > 0) ? i+1 : i;
cmd->sg[i].length = left;
cmd->sg_buff_modified = 1;
break;
+1 -1
View File
@@ -1140,7 +1140,7 @@ static void scst_do_cmd_done(struct scst_cmd *cmd, int result,
cmd->driver_status = driver_byte(result);
if (unlikely(resid != 0)) {
#ifdef EXTRACHECKS
if ((resid < 0) || (resid >= cmd->resp_data_len)) {
if ((resid < 0) || (resid > cmd->resp_data_len)) {
PRINT_ERROR_PR("Wrong resid %d (cmd->resp_data_len=%d)",
resid, cmd->resp_data_len);
} else