Skip to content

Commit

Permalink
Fix error code when allocating a Tx queue, error code value should be…
Browse files Browse the repository at this point in the history
… negative here or the caller will assume that we have allocate a queue success.
  • Loading branch information
zxystd committed Aug 4, 2021
1 parent ebcd6a1 commit df328b2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions itlwm/hal_iwx/ItlIwx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2678,7 +2678,7 @@ iwx_tvqm_enable_txq(struct iwx_softc *sc, int tid, int ssn)
if (err) {
XYLog("%s: could not allocate TX ring DMA memory\n",
DEVNAME(sc));
err = EIO;
err = -ENOMEM;
goto fail;
}
ring.desc = (struct iwx_tfh_tfd*)ring.desc_dma.vaddr;
Expand All @@ -2687,14 +2687,14 @@ iwx_tvqm_enable_txq(struct iwx_softc *sc, int tid, int ssn)
if (err) {
XYLog("%s: could not allocate byte count table DMA memory\n",
DEVNAME(sc));
err = EIO;
err = -ENOMEM;
goto fail;
}

err = iwx_dma_contig_alloc(sc->sc_dmat, &ring.cmd_dma, num_slots * sizeof(struct iwx_device_cmd), IWX_FIRST_TB_SIZE_ALIGN);
if (err) {
XYLog("%s: could not allocate cmd DMA memory\n", DEVNAME(sc));
err = EIO;
err = -ENOMEM;
goto fail;
}
ring.cmd = (struct iwx_device_cmd*)ring.cmd_dma.vaddr;
Expand All @@ -2711,7 +2711,7 @@ iwx_tvqm_enable_txq(struct iwx_softc *sc, int tid, int ssn)
if (err) {
XYLog("%s: could not create TX buf DMA map\n",
DEVNAME(sc));
err = EIO;
err = -EIO;
goto fail;
}
}
Expand All @@ -2729,14 +2729,14 @@ iwx_tvqm_enable_txq(struct iwx_softc *sc, int tid, int ssn)
pkt = hcmd.resp_pkt;
if (!pkt || (pkt->hdr.flags & IWX_CMD_FAILED_MSK)) {
XYLog("SCD_QUEUE_CFG command failed\n");
err = EIO;
err = -EIO;
goto fail;
}

resp_len = iwx_rx_packet_payload_len(pkt);
if (resp_len != sizeof(*resp)) {
XYLog("SCD_QUEUE_CFG returned %zu bytes, expected %zu bytes\n", resp_len, sizeof(*resp));
err = EIO;
err = -EIO;
goto fail;
}

Expand All @@ -2745,7 +2745,7 @@ iwx_tvqm_enable_txq(struct iwx_softc *sc, int tid, int ssn)
wr_idx = le16toh(resp->write_pointer);
if (fwqid >= ARRAY_SIZE(sc->txq)) {
XYLog("queue index %d unsupported", fwqid);
err = EIO;
err = -EIO;
goto fail;
}
wr_idx &= (IWX_DEFAULT_QUEUE_SIZE - 1);
Expand Down

0 comments on commit df328b2

Please sign in to comment.