• Russell King's avatar
    [SERIAL] Remove struct pci_board from init_fn · 4efafa32
    Russell King authored
    Traditionally, we allocated the private array of port parameters based on
    the detected board->num_ports, and then called the init_fn with the board
    pointer (which points into the global table.)  Some init_fn implementations
    modify num_ports, which therefore affects the global table.  Unfortunately,
    this means that if the init_fn increases num_ports (because we have two
    almost identical cards, the first with a smaller number of ports than the
    second), we will overwrite memory which hasn't been allocated to us.
    
    This cset no longer passes the board pointer into the init_fn, but instead
    allows the init_fn to return the number of ports found, or zero to use the
    default value in board->num_ports, or negative error number.
    4efafa32
8250_pci.c 35 KB