From: xu xin <xu.xin16@xxxxxxxxxx> The pointer might be NULL, but it is dereferenced. Reported-by: Zeal Robot <zealci@xxxxxxxxxx> Signed-off-by: xu xin <xu.xin16@xxxxxxxxxx> --- drivers/staging/r8188eu/os_dep/ioctl_linux.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/r8188eu/os_dep/ioctl_linux.c b/drivers/staging/r8188eu/os_dep/ioctl_linux.c index a3e6d761e748..ce4ce9190f5f 100644 --- a/drivers/staging/r8188eu/os_dep/ioctl_linux.c +++ b/drivers/staging/r8188eu/os_dep/ioctl_linux.c @@ -4389,7 +4389,8 @@ static int rtw_dbg_port(struct net_device *dev, pregpriv->rx_stbc = extra_arg; DBG_88E("set rx_stbc =%d\n", pregpriv->rx_stbc); } else { - DBG_88E("get rx_stbc =%d\n", pregpriv->rx_stbc); + if (pregpriv) + DBG_88E("get rx_stbc =%d\n", pregpriv->rx_stbc); } } break; @@ -4401,7 +4402,8 @@ static int rtw_dbg_port(struct net_device *dev, pregpriv->ampdu_enable = extra_arg; DBG_88E("set ampdu_enable =%d\n", pregpriv->ampdu_enable); } else { - DBG_88E("get ampdu_enable =%d\n", pregpriv->ampdu_enable); + if (pregpriv) + DBG_88E("get ampdu_enable =%d\n", pregpriv->ampdu_enable); } } break; -- 2.25.1