[SCSI] hpsa: fix use of uninitialized variable in hpsa_add_msa2xxx_enclosure_device()
authorStephen M. Cameron <scameron@beardog.cce.hp.com>
Fri, 7 Jan 2011 16:55:43 +0000 (10:55 -0600)
committerJames Bottomley <James.Bottomley@suse.de>
Mon, 24 Jan 2011 17:33:32 +0000 (11:33 -0600)
Thanks to Scott Teel for noticing this.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/hpsa.c

index c255f46e6405cbfb56b8c750524d22296be111d7..c6c13b0c68eb45f2b82edc3cda073d2219301165 100644 (file)
@@ -1617,6 +1617,8 @@ static int add_msa2xxx_enclosure_device(struct ctlr_info *h,
        if (lun == 0) /* if lun is 0, then obviously we have a lun 0. */
                return 0;
 
+       memset(scsi3addr, 0, 8);
+       scsi3addr[3] = target;
        if (is_hba_lunid(scsi3addr))
                return 0; /* Don't add the RAID controller here. */
 
@@ -1631,8 +1633,6 @@ static int add_msa2xxx_enclosure_device(struct ctlr_info *h,
                return 0;
        }
 
-       memset(scsi3addr, 0, 8);
-       scsi3addr[3] = target;
        if (hpsa_update_device_info(h, scsi3addr, this_device))
                return 0;
        (*nmsa2xxx_enclosures)++;