Commit 7424a060 authored by Jiayi Ye's avatar Jiayi Ye Committed by Greg Kroah-Hartman

staging: rtl8188eu: core: fix null dereference on exit path in rtw_mlme.c

If adapter is null, null dereference may occur. This patch fixes it.
The following Coccinelle semantic patch was used to find the case.

@@
expression E, E1;
identifier f;
statement S1,S2,S3;
@@

* if (E == NULL)
{
 ... when != if (E == NULL) S1 else S2
     when != E = E1
* E->f
 ... when any
 return ...;
}
else S3
Signed-off-by: default avatarJiayi Ye <yejiayily@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 861374fc
......@@ -1437,7 +1437,7 @@ void rtw_dynamic_check_timer_handlder(void *function_context)
struct registry_priv *pregistrypriv = &adapter->registrypriv;
if (!adapter)
goto exit;
return;
if (!adapter->hw_init_completed)
goto exit;
if ((adapter->bDriverStopped) || (adapter->bSurpriseRemoved))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment