aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2019-11-13 10:13:02 +0100
committerGerd Hoffmann <kraxel@redhat.com>2019-11-13 14:59:39 +0100
commit3bdd2b77656124e3fa7693fbfd7a06f74c38eb87 (patch)
tree98717b18c9b7d4267a9d77e111b8dddfc97a851f
parent9caa19be0e534c687081fbdfcd301406e728c98c (diff)
downloadseabios-3bdd2b77656124e3fa7693fbfd7a06f74c38eb87.tar.gz
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 <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
-rw-r--r--src/hw/ahci.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/hw/ahci.c b/src/hw/ahci.c
index 97a072a1..d45b4307 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);