mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
bhndb(4): Fix unsigned integer underflow in dynamic register window
handling. This resulted in the window target being left uninitialized when an underflow occured. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D7617
This commit is contained in:
parent
ce437beff1
commit
7ba0628f07
1 changed files with 3 additions and 2 deletions
|
|
@ -1728,8 +1728,9 @@ bhndb_io_resource(struct bhndb_softc *sc, bus_addr_t addr, bus_size_t size,
|
|||
|
||||
/* Adjust the window if the I/O request won't fit in the current
|
||||
* target range. */
|
||||
if (addr < dwa->target ||
|
||||
(dwa->target + dwa->win->win_size) - addr < size)
|
||||
if (addr < dwa->target ||
|
||||
addr > dwa->target + dwa->win->win_size ||
|
||||
(dwa->target + dwa->win->win_size) - addr < size)
|
||||
{
|
||||
error = bhndb_dw_set_addr(sc->dev, sc->bus_res, dwa, addr,
|
||||
size);
|
||||
|
|
|
|||
Loading…
Reference in a new issue