[Open-FCoE] [PATCH] libfc: Initialize the fc_fcp_pkt.scsi_pkt_lock

Robert Love robert.w.love at intel.com
Thu Sep 25 17:05:11 UTC 2008


This member was not being initialized after the memory
the memory was allocated so the first use will throw a
warning with lock debugging turned on. Currently this
problem may be masked by another locking issue, but the
lock needs to be initialized regardless of if the warning
is seen or not.

Signed-off-by: Robert Love <robert.w.love at intel.com>
---

 drivers/scsi/libfc/fc_fcp.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
index fd718fc..c3466d4 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -205,6 +205,7 @@ static struct fc_fcp_pkt *fc_fcp_pkt_alloc(struct fc_lport *lp, gfp_t gfp)
 		atomic_set(&sp->ref_cnt, 1);
 		init_timer(&sp->timer);
 		INIT_LIST_HEAD(&sp->list);
+		spin_lock_init(&sp->scsi_pkt_lock);
 	}
 	return sp;
 }




More information about the devel mailing list