]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
staging: rtl8188eu: fix null dereference when kzalloc fails
authorConnor Kuehl <connor.kuehl@canonical.com>
Fri, 27 Sep 2019 21:44:15 +0000 (14:44 -0700)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 13 Nov 2019 23:47:34 +0000 (18:47 -0500)
commitfe12247a1cc513da478f36868b98cd9aa4e7cec8
treec8e3a96e18efab0b80db77ac9ba8c593aeadcfad
parent43fc08cccf34932ab4d9a5acb3a9ad37d96ab3df
staging: rtl8188eu: fix null dereference when kzalloc fails

BugLink: https://bugs.launchpad.net/bugs/1852492
[ Upstream commit 955c1532a34305f2f780b47f0c40cc7c65500810 ]

If kzalloc() returns NULL, the error path doesn't stop the flow of
control from entering rtw_hal_read_chip_version() which dereferences the
null pointer. Fix this by adding a 'goto' to the error path to more
gracefully handle the issue and avoid proceeding with initialization
steps that we're no longer prepared to handle.

Also update the debug message to be more consistent with the other debug
messages in this function.

Addresses-Coverity: ("Dereference after null check")

Signed-off-by: Connor Kuehl <connor.kuehl@canonical.com>
Link: https://lore.kernel.org/r/20190927214415.899-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/os_dep/usb_intf.c