Skip to content
Browse files

[SCSI] dc395x: uninitialized variable in device_alloc()

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>
Acked-by: Oliver Neukum <oliver@neukum.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
  • Loading branch information...
1 parent 4d24834 commit 208afec4f3be8c51ad6eebe6611dd6d2ad2fa298 Dan Carpenter committed with James Bottomley Feb 11, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 drivers/scsi/dc395x.c
View
2 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];

0 comments on commit 208afec

Please sign in to comment.
Something went wrong with that request. Please try again.