diff options
author | Charles Longeau <chl@cvs.openbsd.org> | 2008-11-04 19:20:23 +0000 |
---|---|---|
committer | Charles Longeau <chl@cvs.openbsd.org> | 2008-11-04 19:20:23 +0000 |
commit | 49670475dc6abbf51711fc57daf22bd65d4e6f80 (patch) | |
tree | c1cb273c408a97e241e17148883700a3043d5b04 /sys | |
parent | 26f5a35cbcb98ebb245a0ab91a6520175e28bf35 (diff) |
fix potential null dereference.
Found by LLVM/Clang Static Analyzer.
initial patch from me, rewritten by jsing@
ok jsg@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/if_et.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/dev/pci/if_et.c b/sys/dev/pci/if_et.c index 8330c518b8f..ef2c020da00 100644 --- a/sys/dev/pci/if_et.c +++ b/sys/dev/pci/if_et.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_et.c,v 1.14 2008/10/02 20:21:14 brad Exp $ */ +/* $OpenBSD: if_et.c,v 1.15 2008/11/04 19:20:22 chl Exp $ */ /* * Copyright (c) 2007 The DragonFly Project. All rights reserved. * @@ -974,17 +974,15 @@ int et_init(struct ifnet *ifp) { struct et_softc *sc = ifp->if_softc; - const struct et_bsize *arr; int error, i, s; s = splnet(); et_stop(sc); - arr = ifp->if_mtu <= ETHERMTU ? et_bufsize : NULL; for (i = 0; i < ET_RX_NRING; ++i) { - sc->sc_rx_data[i].rbd_bufsize = arr[i].bufsize; - sc->sc_rx_data[i].rbd_newbuf = arr[i].newbuf; + sc->sc_rx_data[i].rbd_bufsize = et_bufsize[i].bufsize; + sc->sc_rx_data[i].rbd_newbuf = et_bufsize[i].newbuf; } error = et_init_tx_ring(sc); |