[ofa-general] [PATCH][REPOST] drivers/infiniband/ulp/srpt: Fix structure initialization

davem at systemfabricworks.com davem at systemfabricworks.com
Fri Jan 11 14:45:10 PST 2008


This is a repost of an unrelated patch that was inadvertantly included in
[PATCH] drivers/infiniband/ulp/srpt: Fix target data corruption

=====================================================================

   Initialize the reg_req structure before setting bits.

Signed-off-by: David A. McMillen <davem at systemfabricworks.com>
---
 ib_srpt.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/ib_srpt.c b/ib_srpt.c
index 1fb9d56..35c30a5 100644
--- a/ib_srpt.c
+++ b/ib_srpt.c
@@ -450,6 +450,7 @@ static int srpt_refresh_port(struct srpt_port *sport)
 		goto err_query_port;
 
 	if (!sport->mad_agent) {
+		memset(&reg_req, 0, sizeof reg_req);
 		reg_req.mgmt_class = IB_MGMT_CLASS_DEVICE_MGMT;
 		reg_req.mgmt_class_version = IB_MGMT_BASE_VERSION;
 		set_bit(IB_MGMT_METHOD_GET, reg_req.method_mask);



More information about the general mailing list