Skip to content

Commit

Permalink
NTB: Fix dereference before check
Browse files Browse the repository at this point in the history
Remove early dereference of a pointer that is checked later in the code.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Allen Hubbe <Allen.Hubbe@emc.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
  • Loading branch information
Allen Hubbe authored and Jon Mason committed Aug 9, 2015
1 parent 8c9edf6 commit 30a4bb1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/ntb/ntb_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -1692,7 +1692,6 @@ EXPORT_SYMBOL_GPL(ntb_transport_create_queue);
*/
void ntb_transport_free_queue(struct ntb_transport_qp *qp)
{
struct ntb_transport_ctx *nt = qp->transport;
struct pci_dev *pdev;
struct ntb_queue_entry *entry;
u64 qp_bit;
Expand Down Expand Up @@ -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)))
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);
}
Expand Down

0 comments on commit 30a4bb1

Please sign in to comment.