]> xenbits.xensource.com Git - people/ssmith/nc2-2.6.27.git/commitdiff
patch CA-24784-resource-leak
authorSteven Smith <ssmith@weybridge.uk.xensource.com>
Tue, 30 Jun 2009 11:55:47 +0000 (12:55 +0100)
committerSteven Smith <ssmith@weybridge.uk.xensource.com>
Tue, 30 Jun 2009 11:55:47 +0000 (12:55 +0100)
drivers/xen/blkback/blkback.c
drivers/xen/blktap/blktap.c

index 7408056c274bc1e245639737934df43a7eb4aa81..c4b1aafa908603b2d28c1b21680ecb2d8a7c52c6 100644 (file)
@@ -421,14 +421,14 @@ static int do_block_io_op(blkif_t *blkif)
                if (RING_REQUEST_CONS_OVERFLOW(&blk_rings->common, rc))
                        break;
 
-               pending_req = alloc_req();
-               if (NULL == pending_req) {
-                       blkif->st_oo_req++;
+               if (blkif->remove_requested) {
                        more_to_do = 1;
                        break;
                }
 
-               if (blkif->remove_requested) {
+               pending_req = alloc_req();
+               if (NULL == pending_req) {
+                       blkif->st_oo_req++;
                        more_to_do = 1;
                        break;
                }
index a70d5027761dba6ec9714acbc1404e3156e5eb56..04b09d3da577126055313226e50380f748d896b3 100644 (file)
@@ -1143,6 +1143,11 @@ static int do_block_io_op(tap_blkif_t *info)
                        break;
                }
 
+               if (info->remove_requested) {
+                       more_to_do = 1;
+                       break;
+               }
+
                usr_idx = GET_NEXT_REQ(info->idx_map);
                if (usr_idx == INVALID_REQ)
                        break;
@@ -1154,11 +1159,6 @@ static int do_block_io_op(tap_blkif_t *info)
                        break;
                }
 
-               if (info->remove_requested) {
-                       more_to_do = 1;
-                       break;
-               }
-
                switch (blkif->blk_protocol) {
                case BLKIF_PROTOCOL_NATIVE:
                        memcpy(&req, RING_GET_REQUEST(&blk_rings->native, rc),