diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2019-11-13 10:13:02 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2019-11-13 14:59:39 +0100 |
commit | 3bdd2b77656124e3fa7693fbfd7a06f74c38eb87 (patch) | |
tree | 98717b18c9b7d4267a9d77e111b8dddfc97a851f /src | |
parent | 9caa19be0e534c687081fbdfcd301406e728c98c (diff) | |
download | seabios-hppa-3bdd2b77656124e3fa7693fbfd7a06f74c38eb87.zip seabios-hppa-3bdd2b77656124e3fa7693fbfd7a06f74c38eb87.tar.gz seabios-hppa-3bdd2b77656124e3fa7693fbfd7a06f74c38eb87.tar.bz2 |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/hw/ahci.c | 1 |
1 files changed, 1 insertions, 0 deletions
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); |