qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ahci: zero-initialize port struct
@ 2019-11-13  9:18 Gerd Hoffmann
  2019-11-13  9:35 ` Laszlo Ersek
  0 siblings, 1 reply; 14+ messages in thread
From: Gerd Hoffmann @ 2019-11-13  9:18 UTC (permalink / raw)
  To: seabios; +Cc: Peter Maydell, qemu-devel, Gerd Hoffmann

Specifically port->driver.lchs needs clearing, otherwise seabios will
try interpret whatever random crap happens to be there as disk geometry,
which may or may not break boot depending on how lucky you are.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 src/hw/ahci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/hw/ahci.c b/src/hw/ahci.c
index 97a072a1ca81..d45b4307ec68 100644
--- a/src/hw/ahci.c
+++ b/src/hw/ahci.c
@@ -345,6 +345,7 @@ ahci_port_alloc(struct ahci_ctrl_s *ctrl, u32 pnr)
         warn_noalloc();
         return NULL;
     }
+    memset(port, 0, sizeof(*port));
     port->pnr = pnr;
     port->ctrl = ctrl;
     port->list = memalign_tmp(1024, 1024);
-- 
2.18.1



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

end of thread, other threads:[~2019-11-15 11:51 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-13  9:18 [PATCH] ahci: zero-initialize port struct Gerd Hoffmann
2019-11-13  9:35 ` Laszlo Ersek
2019-11-13 14:00   ` [SeaBIOS] " Gerd Hoffmann
2019-11-13 15:03     ` Sam Eiderman
2019-11-13 15:18       ` Sam Eiderman
2019-11-13 15:46         ` Sam Eiderman
2019-11-13 16:12       ` Philippe Mathieu-Daudé
2019-11-13 16:35         ` Sam Eiderman
2019-11-13 16:46           ` Sam Eiderman
2019-11-14  7:20       ` Gerd Hoffmann
2019-11-14  9:08         ` Sam Eiderman
2019-11-15  6:54           ` Gerd Hoffmann
2019-11-15 11:35             ` Gerd Hoffmann
2019-11-15 11:50               ` Sam Eiderman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).