1 From: http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/5012c470f875
2 # HG changeset 740 patch
3 # User Keir Fraser <keir.fraser@citrix.com>
5 # Node ID 5012c470f8757e97c2e0f7eccfafcb1e2367443e
6 # Parent f236d7def9944909bf40015ff4a08817b0803ed9
7 Subject: blkback, blktap: Fix potential resource leak.
8 Patch-mainline: obsolete
10 Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
11 Acked-by: jbeulich@novell.com
13 Index: head-2008-12-01/drivers/xen/blkback/blkback.c
14 ===================================================================
15 --- head-2008-12-01.orig/drivers/xen/blkback/blkback.c 2008-11-10 11:44:21.000000000 +0100
16 +++ head-2008-12-01/drivers/xen/blkback/blkback.c 2008-12-01 11:21:10.000000000 +0100
17 @@ -317,14 +317,14 @@ static int do_block_io_op(blkif_t *blkif
18 if (RING_REQUEST_CONS_OVERFLOW(&blk_rings->common, rc))
21 - pending_req = alloc_req();
22 - if (NULL == pending_req) {
24 + if (kthread_should_stop()) {
29 - if (kthread_should_stop()) {
30 + pending_req = alloc_req();
31 + if (NULL == pending_req) {
36 Index: head-2008-12-01/drivers/xen/blktap/blktap.c
37 ===================================================================
38 --- head-2008-12-01.orig/drivers/xen/blktap/blktap.c 2008-11-10 11:44:21.000000000 +0100
39 +++ head-2008-12-01/drivers/xen/blktap/blktap.c 2008-12-01 11:21:10.000000000 +0100
40 @@ -1286,14 +1286,14 @@ static int do_block_io_op(blkif_t *blkif
44 - pending_req = alloc_req();
45 - if (NULL == pending_req) {
47 + if (kthread_should_stop()) {
52 - if (kthread_should_stop()) {
53 + pending_req = alloc_req();
54 + if (NULL == pending_req) {