提交 30a4bb1e 编写于 作者: A Allen Hubbe 提交者: Jon Mason

NTB: Fix dereference before check

Remove early dereference of a pointer that is checked later in the code.
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NAllen Hubbe <Allen.Hubbe@emc.com>
Signed-off-by: NJon Mason <jdmason@kudzu.us>
上级 8c9edf63
...@@ -1692,7 +1692,6 @@ EXPORT_SYMBOL_GPL(ntb_transport_create_queue); ...@@ -1692,7 +1692,6 @@ EXPORT_SYMBOL_GPL(ntb_transport_create_queue);
*/ */
void ntb_transport_free_queue(struct ntb_transport_qp *qp) void ntb_transport_free_queue(struct ntb_transport_qp *qp)
{ {
struct ntb_transport_ctx *nt = qp->transport;
struct pci_dev *pdev; struct pci_dev *pdev;
struct ntb_queue_entry *entry; struct ntb_queue_entry *entry;
u64 qp_bit; u64 qp_bit;
...@@ -1745,7 +1744,7 @@ void ntb_transport_free_queue(struct ntb_transport_qp *qp) ...@@ -1745,7 +1744,7 @@ void ntb_transport_free_queue(struct ntb_transport_qp *qp)
while ((entry = ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q))) while ((entry = ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q)))
kfree(entry); kfree(entry);
nt->qp_bitmap_free |= qp_bit; qp->transport->qp_bitmap_free |= qp_bit;
dev_info(&pdev->dev, "NTB Transport QP %d freed\n", qp->qp_num); dev_info(&pdev->dev, "NTB Transport QP %d freed\n", qp->qp_num);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册