On Tue, Sep 18, 2018 at 07:55:43AM +0100, Ricardo Mestre wrote: > Hi, > > In the case that a mue(4) device is put in promiscuous mode then hashtbl will > be used uninitialized a little bit down the road so set it 0 like it's done in > a lot of other devices. Coverity ID 1473316. > > OK?
Please also remove the later memset(). There is no need to do it twice. It would also be an option to not issue mue_dataport_write(MUE_DP_SEL_VHF) if the hash is not used (e.g. moving that up into the else block. Which ever option taken it needs to be tested on real hardware. > Index: if_mue.c > =================================================================== > RCS file: /cvs/src/sys/dev/usb/if_mue.c,v > retrieving revision 1.4 > diff -u -p -u -r1.4 if_mue.c > --- if_mue.c 15 Aug 2018 07:13:51 -0000 1.4 > +++ if_mue.c 18 Sep 2018 06:47:54 -0000 > @@ -1016,6 +1016,7 @@ mue_iff(struct mue_softc *sc) > rxfilt = mue_csr_read(sc, reg); > rxfilt &= ~(MUE_RFE_CTL_PERFECT | MUE_RFE_CTL_MULTICAST_HASH | > MUE_RFE_CTL_UNICAST | MUE_RFE_CTL_MULTICAST); > + memset(hashtbl, 0x00, sizeof(hashtbl)); > ifp->if_flags &= ~IFF_ALLMULTI; > > /* Always accept broadcast frames. */ > -- :wq Claudio
