[openib-general] [PATCH applied] remove side effects from kunmap_atomic

Michael S. Tsirkin mst at mellanox.co.il
Wed Nov 2 02:30:08 PST 2005


The following is already applied.

---

On some platforms kunmap_atomic is an empty macro.
Therefore it is unsafe for calls to kunmap_atomic to have side effects,
such as incrementing a counter.

Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>

Index: linux-kernel/drivers/infiniband/ulp/sdp/sdp_send.c
===================================================================
--- linux-kernel/drivers/infiniband/ulp/sdp/sdp_send.c	(revision 3926)
+++ linux-kernel/drivers/infiniband/ulp/sdp/sdp_send.c	(working copy)
@@ -727,7 +727,8 @@ static int sdp_send_iocb_buff_write(stru
 		offset += copy;
 		offset &= (~PAGE_MASK);
 
-		kunmap_atomic(iocb->page_array[counter++], KM_IRQ0);
+		kunmap_atomic(iocb->page_array[counter], KM_IRQ0);
+		++counter;
 		local_irq_restore(flags);
 	}
 
Index: linux-kernel/drivers/infiniband/ulp/sdp/sdp_recv.c
===================================================================
--- linux-kernel/drivers/infiniband/ulp/sdp/sdp_recv.c	(revision 3926)
+++ linux-kernel/drivers/infiniband/ulp/sdp/sdp_recv.c	(working copy)
@@ -610,7 +610,8 @@ static int sdp_read_buff_iocb(struct sdp
 
 		iocb->io_addr += copy;
 
-		kunmap_atomic(iocb->page_array[counter++], KM_IRQ0);
+		kunmap_atomic(iocb->page_array[counter], KM_IRQ0);
+		++counter;
 
 		local_irq_restore(flags);
 	}

-- 
MST



More information about the general mailing list