bna: Check for NULL before deref in bnad_cb_tx_cleanup
authorDavid S. Miller <davem@davemloft.net>
Sun, 12 Sep 2010 19:06:00 +0000 (12:06 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 12 Sep 2010 19:06:00 +0000 (12:06 -0700)
Reported-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bna/bnad.c

index 8158fb93cb4c595351d007a7f2196b2659a40985..e380c0e88f4fb4c629eb60fa150528f5a8b16036 100644 (file)
@@ -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;