Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[linux-2.6-block.git] / drivers / scsi / qla2xxx / qla_target.c
index 985231900aca4222792f37d7cd4da49e136fee06..8a44d1541eb4c5093db4c91b8a4d4701094d588f 100644 (file)
@@ -1881,15 +1881,17 @@ static int qlt_check_reserve_free_req(struct scsi_qla_host *vha,
                else
                        vha->req->cnt = vha->req->length -
                            (vha->req->ring_index - cnt);
-       }
 
-       if (unlikely(vha->req->cnt < (req_cnt + 2))) {
-               ql_dbg(ql_dbg_io, vha, 0x305a,
-                   "qla_target(%d): There is no room in the request ring: vha->req->ring_index=%d, vha->req->cnt=%d, req_cnt=%d Req-out=%d Req-in=%d Req-Length=%d\n",
-                   vha->vp_idx, vha->req->ring_index,
-                   vha->req->cnt, req_cnt, cnt, cnt_in, vha->req->length);
-               return -EAGAIN;
+               if (unlikely(vha->req->cnt < (req_cnt + 2))) {
+                       ql_dbg(ql_dbg_io, vha, 0x305a,
+                           "qla_target(%d): There is no room in the request ring: vha->req->ring_index=%d, vha->req->cnt=%d, req_cnt=%d Req-out=%d Req-in=%d Req-Length=%d\n",
+                           vha->vp_idx, vha->req->ring_index,
+                           vha->req->cnt, req_cnt, cnt, cnt_in,
+                           vha->req->length);
+                       return -EAGAIN;
+               }
        }
+
        vha->req->cnt -= req_cnt;
 
        return 0;