All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] firmware: qemu_fw_cfg.c: potential unintialized variable
@ 2016-04-14  9:33 ` Dan Carpenter
  0 siblings, 0 replies; 18+ messages in thread
From: Dan Carpenter @ 2016-04-14  9:33 UTC (permalink / raw)
  To: Gabriel Somlo
  Cc: Michael S. Tsirkin, qemu-devel, linux-kernel, kernel-janitors

It acpi_acquire_global_lock() return AE_NOT_CONFIGURED then "glk" isn't
initialized, which, if you got very unlucky, could cause a bug.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c
index d999fe3..0e20116 100644
--- a/drivers/firmware/qemu_fw_cfg.c
+++ b/drivers/firmware/qemu_fw_cfg.c
@@ -77,7 +77,7 @@ static inline u16 fw_cfg_sel_endianness(u16 key)
 static inline void fw_cfg_read_blob(u16 key,
 				    void *buf, loff_t pos, size_t count)
 {
-	u32 glk;
+	u32 glk = -1U;
 	acpi_status status;
 
 	/* If we have ACPI, ensure mutual exclusion against any potential

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2016-04-14 20:05 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-14  9:33 [patch] firmware: qemu_fw_cfg.c: potential unintialized variable Dan Carpenter
2016-04-14  9:33 ` [Qemu-devel] " Dan Carpenter
2016-04-14  9:33 ` Dan Carpenter
2016-04-14 18:40 ` Gabriel L. Somlo
2016-04-14 18:40   ` [Qemu-devel] " Gabriel L. Somlo
2016-04-14 18:40   ` Gabriel L. Somlo
2016-04-14 19:12   ` Dan Carpenter
2016-04-14 19:12     ` [Qemu-devel] " Dan Carpenter
2016-04-14 19:12     ` Dan Carpenter
2016-04-14 19:36     ` Gabriel L. Somlo
2016-04-14 19:36       ` [Qemu-devel] " Gabriel L. Somlo
2016-04-14 19:36       ` Gabriel L. Somlo
2016-04-14 20:05       ` Dan Carpenter
2016-04-14 20:05         ` [Qemu-devel] " Dan Carpenter
2016-04-14 20:05         ` Dan Carpenter
2016-04-14 19:51 ` Gabriel L. Somlo
2016-04-14 19:51   ` [Qemu-devel] " Gabriel L. Somlo
2016-04-14 19:51   ` Gabriel L. Somlo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.