Skip to content

Commit

Permalink
staging: rtl8192e: Fix smatch error in r8192E_phy.c
Browse files Browse the repository at this point in the history
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@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Larry Finger authored and Greg Kroah-Hartman committed Sep 6, 2011
1 parent ce7b393 commit 52a7fb0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/staging/rtl8192e/r8192E_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
Expand Down

0 comments on commit 52a7fb0

Please sign in to comment.