Skip to content

Commit

Permalink
staging: vt6656: rxtx.c [BUG] s_vGetFreeContext dead lock on null apTD.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Malcolm Priestley authored and Greg Kroah-Hartman committed Sep 25, 2013
1 parent c3aed23 commit 18e35e0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/staging/vt6656/rxtx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 18e35e0

Please sign in to comment.