From: David S. Miller Date: Sun, 12 Sep 2010 19:06:00 +0000 (-0700) Subject: bna: Check for NULL before deref in bnad_cb_tx_cleanup X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0ea05ce7fd0c1286759933933764aacd12f6ac3a;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git bna: Check for NULL before deref in bnad_cb_tx_cleanup Reported-by: Jiri Slaby Signed-off-by: David S. Miller --- diff --git a/drivers/net/bna/bnad.c b/drivers/net/bna/bnad.c index 8158fb93cb4c..e380c0e88f4f 100644 --- a/drivers/net/bna/bnad.c +++ b/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;