From: Malcolm Priestley Date: Sun, 22 Sep 2013 19:15:58 +0000 (+0100) Subject: staging: vt6656: rxtx.c [BUG] s_vGetFreeContext dead lock on null apTD. X-Git-Tag: v3.12-rc3~3^2~4 X-Git-Url: http://pileus.org/git/?a=commitdiff_plain;h=18e35e081e1bb129c6dc5a5874c260a613cd13d7;p=~andy%2Flinux 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c index fb743a8811b..14f3e852215 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;