]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
staging: rtl8188eu: fix possible null dereference
authorConnor Kuehl <connor.kuehl@canonical.com>
Thu, 26 Sep 2019 15:03:17 +0000 (08:03 -0700)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 29 Jan 2020 04:45:21 +0000 (23:45 -0500)
commitbf8d56e9e247d51ba7aa679d06b1f6bc9537be42
tree13adf405ef8514cb7b56eb37e025ed330803dd4f
parentc4f30350bd93420dd46b1ecaa0e479382b1ec3a5
staging: rtl8188eu: fix possible null dereference

BugLink: https://bugs.launchpad.net/bugs/1859712
[ Upstream commit 228241944a48113470d3c3b46c88ba7fbe0a274b ]

Inside a nested 'else' block at the beginning of this function is a
call that assigns 'psta' to the return value of 'rtw_get_stainfo()'.
If 'rtw_get_stainfo()' returns NULL and the flow of control reaches
the 'else if' where 'psta' is dereferenced, then we will dereference
a NULL pointer.

Fix this by checking if 'psta' is not NULL before reading its
'psta->qos_option' data member.

Addresses-Coverity: ("Dereference null return value")

Signed-off-by: Connor Kuehl <connor.kuehl@canonical.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20190926150317.5894-1-connor.kuehl@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/staging/rtl8188eu/core/rtw_xmit.c