summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalcolm Priestley2013-09-22 21:15:58 +0200
committerGreg Kroah-Hartman2013-09-26 01:53:39 +0200
commit18e35e081e1bb129c6dc5a5874c260a613cd13d7 (patch)
treef6011b972d4dd37852687223263b2b2f8e8c654d
parentStaging: rtl8192u: r819xU_cmdpkt: checking NULL value after doing dev_alloc_skb (diff)
downloadkernel-qcow2-linux-18e35e081e1bb129c6dc5a5874c260a613cd13d7.tar.gz
kernel-qcow2-linux-18e35e081e1bb129c6dc5a5874c260a613cd13d7.tar.xz
kernel-qcow2-linux-18e35e081e1bb129c6dc5a5874c260a613cd13d7.zip
staging: vt6656: rxtx.c [BUG] s_vGetFreeContext dead lock on null apTD.
There seems to be race condition that the device is ndo_start_xmit at a point where the device is closing and apTD is NULL resulting in dead lock. Add a NULL check to apTD and return NULL to calling functions. This is more likely on 64 bit systems. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/vt6656/rxtx.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index fb743a8811bb..14f3e852215d 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -148,6 +148,8 @@ static void *s_vGetFreeContext(struct vnt_private *pDevice)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"GetFreeContext()\n");
for (ii = 0; ii < pDevice->cbTD; ii++) {
+ if (!pDevice->apTD[ii])
+ return NULL;
pContext = pDevice->apTD[ii];
if (pContext->bBoolInUse == false) {
pContext->bBoolInUse = true;