mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-19 21:56:31 +00:00
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:
+1
-1
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user