vioif handles allocation error in attach incorrectly
While reading the code I noticed the following snippet:
sc->sc_rx_vq = virtio_alloc_vq(&sc->sc_virtio, 0,
VIOIF_RX_QLEN, VIOIF_INDIRECT_MAX, "rx");
sc->sc_tx_vq = virtio_alloc_vq(&sc->sc_virtio, 1,
VIOIF_TX_QLEN, VIOIF_INDIRECT_MAX, "tx");
if (!sc->sc_rx_vq) /* <--------------------- ISSUE HERE */
I'm guessing this was a copy and paste error. The goto exit_alloc2 is actually unreachable because the conditional checks for a failure that's already been exited for.
By the way I know this source file was modeled after the NetBSD code. I've tracked down the equivalent NetBSD file, and it looks like they've diverged enough not to have this (exact) issue.
Updated by Electric Monk about 3 years ago
- % Done changed from 90 to 100
- Status changed from In Progress to Closed
commit 0062e03dc6d700fc8eaaf8174448181babab8179 Author: Dillon Amburgey <email@example.com> Date: 2017-03-27T15:42:16.000Z 7985 vioif handles allocation error in attach incorrectly Reviewed by: Jason King <firstname.lastname@example.org> Approved by: Robert Mustacchi <email@example.com>