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>
This commit is contained in:
parent
9caa19be0e
commit
3bdd2b7765
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue