* [patch] [SCSI] dc395x: uninitialized variable in device_alloc()
@ 2013-02-11 19:03 Dan Carpenter
2013-02-13 12:06 ` Oliver Neukum
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2013-02-11 19:03 UTC (permalink / raw)
To: Oliver Neukum
Cc: Ali Akcaagac, Jamie Lenehan, James E.J. Bottomley, dc395x,
linux-scsi, kernel-janitors
This bug was introduced back in bitkeeper days in 2003. We use
"dcb->dev_mode" before it has been initialized.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c
index 865c64f..fed486bf 100644
--- a/drivers/scsi/dc395x.c
+++ b/drivers/scsi/dc395x.c
@@ -3747,13 +3747,13 @@ static struct DeviceCtlBlk *device_alloc(struct AdapterCtlBlk *acb,
dcb->max_command = 1;
dcb->target_id = target;
dcb->target_lun = lun;
+ dcb->dev_mode = eeprom->target[target].cfg0;
#ifndef DC395x_NO_DISCONNECT
dcb->identify_msg =
IDENTIFY(dcb->dev_mode & NTC_DO_DISCONNECT, lun);
#else
dcb->identify_msg = IDENTIFY(0, lun);
#endif
- dcb->dev_mode = eeprom->target[target].cfg0;
dcb->inquiry7 = 0;
dcb->sync_mode = 0;
dcb->min_nego_period = clock_period[period_index];
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-02-13 12:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-11 19:03 [patch] [SCSI] dc395x: uninitialized variable in device_alloc() Dan Carpenter
2013-02-13 12:06 ` Oliver Neukum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox