[ 3.5.y.z extended stable ] Patch "dc395x: uninitialized variable in device_alloc()" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Mon Mar 4 20:49:06 UTC 2013

This is a note to let you know that I have just added a patch titled

    dc395x: uninitialized variable in device_alloc()

to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree 
which can be found at:


If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.y.z tree, see



>From eb4210c32e8648d57febc8cf3f83598d1bacbb79 Mon Sep 17 00:00:00 2001
From: Dan Carpenter <dan.carpenter at oracle.com>
Date: Mon, 11 Feb 2013 22:03:18 +0300
Subject: [PATCH] dc395x: uninitialized variable in device_alloc()

commit 208afec4f3be8c51ad6eebe6611dd6d2ad2fa298 upstream.

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 at oracle.com>
Acked-by: Oliver Neukum <oliver at neukum.org>
Signed-off-by: James Bottomley <JBottomley at Parallels.com>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
 drivers/scsi/dc395x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c
index 13aeca3..48105fc 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);
 	dcb->identify_msg = IDENTIFY(0, lun);
-	dcb->dev_mode = eeprom->target[target].cfg0;
 	dcb->inquiry7 = 0;
 	dcb->sync_mode = 0;
 	dcb->min_nego_period = clock_period[period_index];

More information about the kernel-team mailing list