+++ /dev/null
-From: http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/5012c470f875
-# HG changeset 740 patch
-# User Keir Fraser <keir.fraser@citrix.com>
-# Date 1227697833 0
-# Node ID 5012c470f8757e97c2e0f7eccfafcb1e2367443e
-# Parent f236d7def9944909bf40015ff4a08817b0803ed9
-Subject: blkback, blktap: Fix potential resource leak.
-Patch-mainline: obsolete
-
-Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
-Acked-by: jbeulich@novell.com
-
-Index: head-2008-12-01/drivers/xen/blkback/blkback.c
-===================================================================
---- head-2008-12-01.orig/drivers/xen/blkback/blkback.c 2008-11-10 11:44:21.000000000 +0100
-+++ head-2008-12-01/drivers/xen/blkback/blkback.c 2008-12-01 11:21:10.000000000 +0100
-@@ -317,14 +317,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 (kthread_should_stop()) {
- more_to_do = 1;
- break;
- }
-
-- if (kthread_should_stop()) {
-+ pending_req = alloc_req();
-+ if (NULL == pending_req) {
-+ blkif->st_oo_req++;
- more_to_do = 1;
- break;
- }
-Index: head-2008-12-01/drivers/xen/blktap/blktap.c
-===================================================================
---- head-2008-12-01.orig/drivers/xen/blktap/blktap.c 2008-11-10 11:44:21.000000000 +0100
-+++ head-2008-12-01/drivers/xen/blktap/blktap.c 2008-12-01 11:21:10.000000000 +0100
-@@ -1286,14 +1286,14 @@ static int do_block_io_op(blkif_t *blkif
- break;
- }
-
-- pending_req = alloc_req();
-- if (NULL == pending_req) {
-- blkif->st_oo_req++;
-+ if (kthread_should_stop()) {
- more_to_do = 1;
- break;
- }
-
-- if (kthread_should_stop()) {
-+ pending_req = alloc_req();
-+ if (NULL == pending_req) {
-+ blkif->st_oo_req++;
- more_to_do = 1;
- break;
- }