public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -tip][SCSI] scsi: scsi_transport_iscsi.c initialize the variable before it get used
@ 2009-05-26 15:19 Jaswinder Singh Rajput
  2009-05-26 15:28 ` James Bottomley
  2009-05-26 21:36 ` Mike Christie
  0 siblings, 2 replies; 6+ messages in thread
From: Jaswinder Singh Rajput @ 2009-05-26 15:19 UTC (permalink / raw)
  To: James Bottomley, linux-scsi, Ingo Molnar, x86 maintainers, LKML

I am watching this problem from long time in -tip.

Subject: [PATCH] scsi: scsi_transport_iscsi.c initialize the variable before it get used

In some cases, err will be used uninitialized.

Also fixed compilation warning :

 CC      drivers/scsi/scsi_transport_iscsi.o
drivers/scsi/scsi_transport_iscsi.c: In function ‘iscsi_add_session’:
drivers/scsi/scsi_transport_iscsi.c:678: warning: ‘err’ may be used uninitialized in this function

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
---
 drivers/scsi/scsi_transport_iscsi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index 0947954..e78cde2 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -675,7 +675,7 @@ int iscsi_add_session(struct iscsi_cls_session *session, unsigned int target_id)
 	struct iscsi_cls_host *ihost;
 	unsigned long flags;
 	unsigned int id = target_id;
-	int err;
+	int err = 0;
 
 	ihost = shost->shost_data;
 	session->sid = atomic_add_return(1, &iscsi_session_nr);
-- 
1.6.0.6



--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-05-26 21:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-26 15:19 [PATCH -tip][SCSI] scsi: scsi_transport_iscsi.c initialize the variable before it get used Jaswinder Singh Rajput
2009-05-26 15:28 ` James Bottomley
2009-05-26 16:00   ` Jaswinder Singh Rajput
2009-05-26 16:06     ` James Bottomley
2009-05-26 16:21       ` Jaswinder Singh Rajput
2009-05-26 21:36 ` Mike Christie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox