pFifoHead is dereferenced before it is checked for NULL which implies it can potentially be NULL. Thus move the check before the dereference. Found by the coverity scanner, CID 1127221. Reported-by: <scan-admin@xxxxxxxxxxxx> Signed-off-by: Tobias Klauser <tklauser@xxxxxxxxxx> --- drivers/staging/vt6656/rxtx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c index 19a8741..1b1155a 100644 --- a/drivers/staging/vt6656/rxtx.c +++ b/drivers/staging/vt6656/rxtx.c @@ -805,6 +805,9 @@ static u16 s_vGenerateTxParameter(struct vnt_private *pDevice, u16 wFifoCtl; u8 byFBOption = AUTO_FB_NONE; + if (!pFifoHead) + return 0; + pFifoHead->current_rate = cpu_to_le16(wCurrentRate); wFifoCtl = pFifoHead->wFIFOCtl; @@ -813,9 +816,6 @@ static u16 s_vGenerateTxParameter(struct vnt_private *pDevice, else if (wFifoCtl & FIFOCTL_AUTO_FB_1) byFBOption = AUTO_FB_1; - if (!pFifoHead) - return 0; - if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) { if (need_rts) { struct vnt_rrv_time_rts *pBuf = -- 1.7.9.5 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel