Browse Source

bna: Check for NULL before deref in bnad_cb_tx_cleanup

Reported-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller 14 years ago
parent
commit
0ea05ce7fd
1 changed files with 2 additions and 1 deletions
  1. 2 1
      drivers/net/bna/bnad.c

+ 2 - 1
drivers/net/bna/bnad.c

@@ -867,11 +867,12 @@ bnad_cb_tx_resume(struct bnad *bnad, struct bna_tcb *tcb)
 static void
 bnad_cb_tx_cleanup(struct bnad *bnad, struct bna_tcb *tcb)
 {
-	struct bnad_unmap_q *unmap_q = tcb->unmap_q;
+	struct bnad_unmap_q *unmap_q;
 
 	if (!tcb || (!tcb->unmap_q))
 		return;
 
+	unmap_q = tcb->unmap_q;
 	if (!unmap_q->unmap_array)
 		return;