At driver attach, cd (inside M_ZERO softc) is 0.

But if a reset (or suspend/resume) happens, then sis_rx_prod/sis_rx_cons
will be within the middle of the ring, and it isn't clear if everything
else in the chip+driver are ready for that.

ok deraadt



Kevin Lo <ke...@kevlo.org> wrote:

> ok?
> 
> Index: sys/dev/pci/if_sis.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/pci/if_sis.c,v
> retrieving revision 1.137
> diff -u -p -u -p -r1.137 if_sis.c
> --- sys/dev/pci/if_sis.c      10 Jul 2020 13:26:38 -0000      1.137
> +++ sys/dev/pci/if_sis.c      15 Jul 2020 07:11:47 -0000
> @@ -1285,7 +1285,7 @@ sis_ring_init(struct sis_softc *sc)
>               ld->sis_rx_list[i].sis_ctl = 0;
>       }
>  
> -     cd->sis_rx_prod = cd->sis_rx_cons;
> +     cd->sis_rx_prod = cd->sis_rx_cons = 0;
>       if_rxr_init(&cd->sis_rx_ring, 2, SIS_RX_LIST_CNT - 1);
>       sis_fill_rx_ring(sc);
>  
> 

Reply via email to