staging: rtl8188eu: core: fix null dereference on exit path in rtw_mlme.c
authorJiayi Ye <yejiayily@gmail.com>
Thu, 23 Oct 2014 14:05:10 +0000 (22:05 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Oct 2014 02:33:05 +0000 (10:33 +0800)
commit7424a0609063826a60a933ace872a1e747dfeede
tree68ee154a4d57734c2c023a3fc0576abc5ac72e08
parent861374fcf3e88e290b026fbddf7b5b27898df4b6
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: Jiayi Ye <yejiayily@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_mlme.c