staging: rtl8188eu: avoid a null dereference on pmlmepriv
authorColin Ian King <colin.king@canonical.com>
Fri, 20 Oct 2017 18:40:24 +0000 (20:40 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 Dec 2017 12:40:39 +0000 (13:40 +0100)
commite3912c2aef4ea046568ace227aa5d54bad44cac9
treec4297a80c2aa35997d2e59b085888dd9628255a1
parenta99611910dd745e940fc1a0cdab15aadf07c3e23
staging: rtl8188eu: avoid a null dereference on pmlmepriv

[ Upstream commit 123c0aab0050cd0e07ce18e453389fbbb0a5a425 ]

There is a check on pmlmepriv before dereferencing it when
vfree'ing pmlmepriv->free_bss_buf however the previous call
to rtw_free_mlme_priv_ie_data deferences pmlmepriv causing
a null pointer deference if it is null.  Avoid this by also
calling rtw_free_mlme_priv_ie_data if the pointer is non-null.

Detected by CoverityScan, CID#1230262 ("Dereference before null check")
Fixes: 7b464c9fa5cc ("staging: r8188eu: Add files for new driver - part 4")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_mlme.c