From 3bdd2b77656124e3fa7693fbfd7a06f74c38eb87 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Wed, 13 Nov 2019 10:13:02 +0100 Subject: ahci: zero-initialize port struct Specifically port->drive.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 Reviewed-by: Laszlo Ersek --- src/hw/ahci.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/hw/ahci.c b/src/hw/ahci.c index 97a072a..d45b430 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); -- cgit v1.2.1