From: Gerd Hoffmann Date: Wed, 13 Nov 2019 09:13:02 +0000 (+0100) Subject: ahci: zero-initialize port struct X-Git-Tag: rel-1.13.0~11 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=3bdd2b77656124e3fa7693fbfd7a06f74c38eb87;p=seabios.git 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 --- 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);