NTB: ntb_process_tx error path bug
authorJon Mason <jdmason@kudzu.us>
Fri, 18 Dec 2015 18:22:37 +0000 (13:22 -0500)
committerJon Mason <jdmason@kudzu.us>
Mon, 11 Jan 2016 14:51:17 +0000 (09:51 -0500)
The transmit overrun avoidance error path in ntb_process_tx accidentally
swapped the first two values being passed to the tx_handler client.
This could result in crashes in the ntb_netdev (or other out-of-tree NTB
clients).

Reported-by: Alex Depoutovitch <alex@pernixdata.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
drivers/ntb/ntb_transport.c

index 60654d524858c4bf52f6c5b5668c90719f523eda..bd1bcb323128f80c3874bd35ccf963ad83ecb4a5 100644 (file)
@@ -1532,7 +1532,7 @@ static int ntb_process_tx(struct ntb_transport_qp *qp,
 
        if (entry->len > qp->tx_max_frame - sizeof(struct ntb_payload_header)) {
                if (qp->tx_handler)
-                       qp->tx_handler(qp->cb_data, qp, NULL, -EIO);
+                       qp->tx_handler(qp, qp->cb_data, NULL, -EIO);
 
                ntb_list_add(&qp->ntb_tx_free_q_lock, &entry->entry,
                             &qp->tx_free_q);