mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH linux/linux-next] aic94xx: asd_read_flash: Fix uninitialized variable warning
@ 2013-02-20 19:49 Tim Gardner
  0 siblings, 0 replies; only message in thread
From: Tim Gardner @ 2013-02-20 19:49 UTC (permalink / raw)
  To: linux-kernel; +Cc: Tim Gardner, James E.J. Bottomley, linux-scsi

drivers/scsi/aic94xx/aic94xx_sds.c: In function 'asd_read_flash':
drivers/scsi/aic94xx/aic94xx_sds.c:597:21: warning: 'offs' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/scsi/aic94xx/aic94xx_sds.c:985:6: note: 'offs' was declared here

If asd_find_flash_de() fails, then 'offs' could be used without having been initialized.
Set 'offs' to zero which seems like the most reasonable value.

Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
---
 drivers/scsi/aic94xx/aic94xx_sds.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/aic94xx/aic94xx_sds.c b/drivers/scsi/aic94xx/aic94xx_sds.c
index edb43fd..d11b4d7 100644
--- a/drivers/scsi/aic94xx/aic94xx_sds.c
+++ b/drivers/scsi/aic94xx/aic94xx_sds.c
@@ -1003,6 +1003,7 @@ static int asd_process_ctrl_a_user(struct asd_ha_struct *asd_ha,
 		}
 
 		size = sizeof(struct asd_ctrla_phy_settings);
+		offs = 0;
 		ps = &dflt_ps;
 	}
 
-- 
1.7.9.5


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-02-20 19:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-20 19:49 [PATCH linux/linux-next] aic94xx: asd_read_flash: Fix uninitialized variable warning Tim Gardner

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

all inboxes | Powered by JetHome®