[PATCH 7/9 V2] staging: rtl8192e: Fix smatch error in r8192E_phy.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Smatch reports the following:

  CHECK   drivers/staging/rtl8192e/r8192E_phy.c
drivers/staging/rtl8192e/r8192E_phy.c +940 rtl8192_phy_SwChnlStepByStep(92) error: potential null derefence 'CurrentCmd'.

Signed-off-by: Larry Finger <Larry.Finger@xxxxxxxxxxxx>
---

V2 - no changes
---
 drivers/staging/rtl8192e/r8192E_phy.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/r8192E_phy.c
index 83e00d7..7ec6139 100644
--- a/drivers/staging/rtl8192e/r8192E_phy.c
+++ b/drivers/staging/rtl8192e/r8192E_phy.c
@@ -937,7 +937,7 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel,
 				break;
 			}
 
-			if (CurrentCmd->CmdID == CmdID_End) {
+			if (CurrentCmd && CurrentCmd->CmdID == CmdID_End) {
 				if ((*stage) == 2) {
 					return true;
 				} else {
@@ -947,6 +947,8 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel,
 				}
 			}
 
+			if (!CurrentCmd)
+				continue;
 			switch (CurrentCmd->CmdID) {
 			case CmdID_SetTxPowerLevel:
 				if (priv->IC_Cut > (u8)VERSION_8190_BD)
-- 
1.7.3.4

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux