tree ea36d425400c09f3edbeff8fca833fc9bf34ace3 parent 5a72aac00fcd1412d7f3cea1214c5eae3f10566e author Sean Hefty <[EMAIL PROTECTED]> Tue Apr 12 08:26:35 2005 committer Linus Torvalds <[EMAIL PROTECTED]> Tue Apr 12 08:26:35 2005
[PATCH] IB: Keep MAD work completion valid Replace the *wc field in ib_mad_recv_wc from pointing to a structure on the stack to one allocated with the received MAD buffer. This allows a client to access the *wc field after their receive completion handler has returned. Signed-off-by: Sean Hefty <[EMAIL PROTECTED]> Signed-off-by: Roland Dreier <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]> mad.c | 3 ++- mad_priv.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) Index: drivers/infiniband/core/mad.c =================================================================== --- 53d2c4f149faec8bc6e4b0b5140a645b8c157f01/drivers/infiniband/core/mad.c (mode:100644 sha1:2de257982351b0e9030fb4a0d383d2bf7ba88287) +++ ea36d425400c09f3edbeff8fca833fc9bf34ace3/drivers/infiniband/core/mad.c (mode:100644 sha1:7d453a65af83c891631317a73863fb7fef3a525e) @@ -1600,7 +1600,8 @@ DMA_FROM_DEVICE); /* Setup MAD receive work completion from "normal" work completion */ - recv->header.recv_wc.wc = wc; + recv->header.wc = *wc; + recv->header.recv_wc.wc = &recv->header.wc; recv->header.recv_wc.mad_len = sizeof(struct ib_mad); recv->header.recv_wc.recv_buf.mad = &recv->mad.mad; recv->header.recv_wc.recv_buf.grh = &recv->grh; Index: drivers/infiniband/core/mad_priv.h =================================================================== --- 53d2c4f149faec8bc6e4b0b5140a645b8c157f01/drivers/infiniband/core/mad_priv.h (mode:100644 sha1:62dd1592d4ab7c1891f437e90dd27788a537187e) +++ ea36d425400c09f3edbeff8fca833fc9bf34ace3/drivers/infiniband/core/mad_priv.h (mode:100644 sha1:dfb689851285ab9770204d780663b83036746439) @@ -69,6 +69,7 @@ struct ib_mad_private_header { struct ib_mad_list_head mad_list; struct ib_mad_recv_wc recv_wc; + struct ib_wc wc; DECLARE_PCI_UNMAP_ADDR(mapping) } __attribute__ ((packed)); - To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html