Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Malcolm Priestley and committed by
Greg Kroah-Hartman
18e35e08 c3aed231

+2
+2
drivers/staging/vt6656/rxtx.c
··· 148 148 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"GetFreeContext()\n"); 149 149 150 150 for (ii = 0; ii < pDevice->cbTD; ii++) { 151 + if (!pDevice->apTD[ii]) 152 + return NULL; 151 153 pContext = pDevice->apTD[ii]; 152 154 if (pContext->bBoolInUse == false) { 153 155 pContext->bBoolInUse = true;