summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2023-04-28 10:18:59 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2023-04-28 10:18:59 +0000
commita999cd8e0cb9a88d632d2559c89e1d89020992a5 (patch)
treee1dc672f08e536a9492150d28120e99e5fc4911f
parent15ff45cb12933933993ea38f0e268ba458878cfc (diff)
Remove error handling around mallocarray(9). I cannot fail when
called with M_WAITOK. OK kevlo@
-rw-r--r--sys/dev/pci/if_igc.c7
-rw-r--r--sys/dev/pci/if_ix.c7
-rw-r--r--sys/dev/pci/if_oce.c7
3 files changed, 9 insertions, 12 deletions
diff --git a/sys/dev/pci/if_igc.c b/sys/dev/pci/if_igc.c
index e76ffcbfd1f..db84e23bb68 100644
--- a/sys/dev/pci/if_igc.c
+++ b/sys/dev/pci/if_igc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_igc.c,v 1.12 2023/03/09 00:13:47 chris Exp $ */
+/* $OpenBSD: if_igc.c,v 1.13 2023/04/28 10:18:57 bluhm Exp $ */
/*-
* SPDX-License-Identifier: BSD-2-Clause
*
@@ -1209,9 +1209,8 @@ igc_rxrinfo(struct igc_softc *sc, struct if_rxrinfo *ifri)
struct rx_ring *rxr;
int error, i, n = 0;
- if ((ifr = mallocarray(sc->sc_nqueues, sizeof(*ifr), M_DEVBUF,
- M_WAITOK | M_ZERO)) == NULL)
- return ENOMEM;
+ ifr = mallocarray(sc->sc_nqueues, sizeof(*ifr), M_DEVBUF,
+ M_WAITOK | M_ZERO);
for (i = 0; i < sc->sc_nqueues; i++) {
rxr = &sc->rx_rings[i];
diff --git a/sys/dev/pci/if_ix.c b/sys/dev/pci/if_ix.c
index ab9edd51023..870c3349fb3 100644
--- a/sys/dev/pci/if_ix.c
+++ b/sys/dev/pci/if_ix.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ix.c,v 1.192 2023/02/06 20:27:44 jan Exp $ */
+/* $OpenBSD: if_ix.c,v 1.193 2023/04/28 10:18:57 bluhm Exp $ */
/******************************************************************************
@@ -640,9 +640,8 @@ ixgbe_rxrinfo(struct ix_softc *sc, struct if_rxrinfo *ifri)
u_int n = 0;
if (sc->num_queues > 1) {
- if ((ifr = mallocarray(sc->num_queues, sizeof(*ifr), M_DEVBUF,
- M_WAITOK | M_ZERO)) == NULL)
- return (ENOMEM);
+ ifr = mallocarray(sc->num_queues, sizeof(*ifr), M_DEVBUF,
+ M_WAITOK | M_ZERO);
} else
ifr = &ifr1;
diff --git a/sys/dev/pci/if_oce.c b/sys/dev/pci/if_oce.c
index 084fc7af888..2a01f022d94 100644
--- a/sys/dev/pci/if_oce.c
+++ b/sys/dev/pci/if_oce.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_oce.c,v 1.106 2022/03/11 18:00:48 mpi Exp $ */
+/* $OpenBSD: if_oce.c,v 1.107 2023/04/28 10:18:58 bluhm Exp $ */
/*
* Copyright (c) 2012 Mike Belopuhov
@@ -902,9 +902,8 @@ oce_rxrinfo(struct oce_softc *sc, struct if_rxrinfo *ifri)
u_int n = 0;
if (sc->sc_nrq > 1) {
- if ((ifr = mallocarray(sc->sc_nrq, sizeof(*ifr), M_DEVBUF,
- M_WAITOK | M_ZERO)) == NULL)
- return (ENOMEM);
+ ifr = mallocarray(sc->sc_nrq, sizeof(*ifr), M_DEVBUF,
+ M_WAITOK | M_ZERO);
} else
ifr = &ifr1;