From: <vl...@us...> - 2007-03-02 15:07:18
|
Revision: 100 http://svn.sourceforge.net/scst/?rev=100&view=rev Author: vlnb Date: 2007-03-02 07:06:55 -0800 (Fri, 02 Mar 2007) Log Message: ----------- Fixed case, when resid == cmd->resp_data_len for real devices Modified Paths: -------------- trunk/scst/src/scst_lib.c trunk/scst/src/scst_targ.c Modified: trunk/scst/src/scst_lib.c =================================================================== --- trunk/scst/src/scst_lib.c 2007-02-28 12:55:35 UTC (rev 99) +++ trunk/scst/src/scst_lib.c 2007-03-02 15:06:55 UTC (rev 100) @@ -132,7 +132,7 @@ 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; Modified: trunk/scst/src/scst_targ.c =================================================================== --- trunk/scst/src/scst_targ.c 2007-02-28 12:55:35 UTC (rev 99) +++ trunk/scst/src/scst_targ.c 2007-03-02 15:06:55 UTC (rev 100) @@ -1140,7 +1140,7 @@ 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 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |